native SQL_SetAffinity(const driver[]);
driver | The name of a driver to use. |
Sets driver affinity. You can use this to force a particular driver implementation. This will automatically change all SQL natives in your plugin to be "bound" to the module in question.
Using this while you have open handles to another database type will cause problems. I.e., you cannot open a handle, switch affinity, then close the handle with a different driver.
Switching affinity is an O(n * m) operation, where n is the number of SQL natives and m is the number of used natives in total.
Intuitive programmers will note that this causes problems for threaded queries. You will have to either force your script to work under one affinity, or to pack the affinity type into the query data, check it against the current, then set the new affinity if necessary. Then, restore the old one for safety.
If no module with the given name is found, returns 0. Unless your plugin is bult to handle different driver types at once, you should let this error pass.
This documentation was generated automatically using pawn-docgen written by xPaw for AlliedMods.