How can we create more than one database?

Forum for posting problems using QxOrm library

How can we create more than one database?

Postby phonix » Mon Mar 30, 2020 4:11 am

I want to create more than one database using QxORM. How can we do that?
phonix
 
Posts: 6
Joined: Mon Mar 30, 2020 4:04 am

Re: How can we create more than one database?

Postby qxorm » Fri Apr 03, 2020 9:42 am

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)
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: How can we create more than one database?

Postby phonix » Sat Apr 11, 2020 2:23 pm

Thanks, I can do it now.
phonix
 
Posts: 6
Joined: Mon Mar 30, 2020 4:04 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 4 guests

cron