U++ framework
Do not panic. Ask here before giving up.

Home » U++ Library support » U++ SQL » More .sch files?
Re: More .sch files? [message #34833 is a reply to message #34825] Wed, 14 December 2011 07:19 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14291
Registered: November 2005
Ultimate Member
Wolfgang wrote on Tue, 13 December 2011 15:31

thank you for answer but how to tell the SqlSession which .sch file it should use?

do you told me this - or?
Sqlite3Session sql_db1;
Sqlite3Session sql_db2;

if (!sql_db1.Open(path)) { /* break */ }
if (!sql_db2.Open(path)) { /* break */ }

SqlSchema sch(SQLITE3);

All_Tables(sch);
SqlPerformScript(sql_db1, sch.Upgrade());
SqlPerformScript(sql_db1, sch.Attributes());

SqlPerformScript(sql_db2, sch.Upgrade());
SqlPerformScript(sql_db2, sch.Attributes());


I understand how to tell SqlPerformScript which session it should perform but I dont see the connection between
#define MODEL <urlaub/urlaub.sch>

and
SqlSchema sch(SQLITE3);



I see...

Well, it is all a bit complicated, however:

All_Tables

is static. So if you need more databases with different models, you have to place those schema includes in different files, mark them "no blitz" and create schema upload in each file.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: sql + editstring
Next Topic: BUG with "Run to cursor (in debug)"
Goto Forum:
  


Current Time: Thu Sep 10 02:54:27 GMT+2 2026

Total time taken to generate the page: 0.00611 seconds