Page 1 of 1

How can we create more than one database?

PostPosted: Mon Mar 30, 2020 4:11 am
by phonix
I want to create more than one database using QxORM. How can we do that?

Re: How can we create more than one database?

PostPosted: Fri Apr 03, 2020 9:42 am
by qxorm
Sorry, I don't understand your question.
You can create as many databases as you want.

To create them, I don't recommend to use qx::dao::create_table (which works only with SQLite, and just to create samples).
So I would recommend to use :
- a tool dedicated to your SGBD
- or QxEntityEditor application

Then QxOrm library can manage several databases : you can for example define 1 database connexion per thread.
You can define it with singleton class : qx::QxSqlDatabase
All methods have this signature :
Code: Select all
void setDatabaseName (const QString &s, bool bJustForCurrentThread=false, QSqlDatabase *pJustForThisDatabase=NULL)

Re: How can we create more than one database?

PostPosted: Sat Apr 11, 2020 2:23 pm
by phonix
Thanks, I can do it now.