as I'm concurrently connecting to MSSQL and MySQL databases on various threads ... change to associate these settings per sql generator rather than globally?
For now, you can't specify different SQL generators : it is the same in all the application.
What you can do is just specify your own database connexion before calling a query.
I think that this kind of API could be implemented quite easily : in singleton class qx:QxSqlDatabase which store global settings :
1- for all setXXX() methods, add an optional parameter : bool bJustForCurrentThread, for example :
- Code: Select all
void setSqlDelimiterForTableName(const QStringList & lst, bool bJustForCurrentThread = false);
2- for all getXXX() methods, we keep current definition, so :
* it gets setting defined in the thread if it exists,
* Otherwise, it gets setting defined at global level.
What do you think with this API ?