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

Home » U++ Library support » U++ SQL » Application with two different databases schema
Application with two different databases schema [message #53841] Fri, 08 May 2020 17:41 Go to previous message
forlano is currently offline  forlano
Messages: 1235
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

I have a program that stores data on a local Sqlite3 db. Moreover it needs to connect to an online MySql db.
Can this scenario be managed? In case of affermative answer how to do it? It is convenient to have one .sch file or two?...

After trying several possibilities, to avoid error from CLANG (many duplicate and redefinition), I found a solution that is accepeted by CLANG. I am using a single .SCH file with the definition of the two dbs. In a .h file I have

#define SCHEMADIALECT <plugin/sqlite3/Sqlite3Schema.h>
#define MODEL <OrionVR/db.sch>

#define SCHEMADIALECT2 <MySql/MySqlSchema.h>

#include <Sql/sch_header.h>


Then in a .cpp file I used

#include "Sql/sch_schema.h"
#include "Sql/sch_source.h"


It compiles but the program crash immediately.
I am sure I am doing weird things. Which is the correct way to do it?

Thanks,
Luigi
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Jsonize() in database table structures (S_*) [patch]
Next Topic: OleDBSession in Archive
Goto Forum:
  


Current Time: Sun May 24 08:43:42 GMT+2 2026

Total time taken to generate the page: 0.00567 seconds