[odb-users] how to generate two db files with different schemas and embedded into an application

Jed Wu jed.wu at ringcentral.com
Thu Aug 18 12:23:37 EDT 2022


Hi, per my test, if I  define and use more then one schema(default or custom), it will throw out an exception like "unknown database schema ‘myschema’”. Do you have an example that can work well with multiple schema names?

On Aug 16, 2022, at 19:19, Boris Kolpackov <boris at codesynthesis.com<mailto:boris at codesynthesis.com>> wrote:


[EXTERNAL]


Jed Wu <jed.wu at ringcentral.com<mailto:jed.wu at ringcentral.com>> writes:

How can I call create_schema() in contact-odb.cxx for contact.db and
create_schema in phonenumber-odb.cxx for phonenumber.db?

The ODB compiler has the --schema-name option that allows you to
assign names to your database schemas. This name can then be passed
as the second argument to odb::schema_catalog::create_schema(). This
is covered in Section 3.4, "Database" in the ODB manual:

https://urldefense.com/v3/__https://codesynthesis.com/products/odb/doc/manual.xhtml*3.4__;Iw!!J-1DKIBqn-Pi!FcMXX5sKCggEPUvS-CjiPGfSM3buQntFKNBz1dYZZfpVHwqsMfeU0jIagNbSF4SfRU5DB5pCK5Nji4touqRC$



More information about the odb-users mailing list