[odb-users] RE: Generate DDL and DML methods in separate output
pstath at axxcelera.com
Mon Feb 27 13:28:33 EST 2012
I had already thought of the "--schema-format sql" option.
I had also thought of generating the code with both embedded and sql arguments and creating two separate libraries.
I still would like to use the create_schema() methods to create the database,
as well as populate initial default datasets and lookup tables programmatically.
I would be very interested in seeing this feature implemented.
It would make using ODB in an embedded environment more palatable.
> -----Original Message-----
> From: Boris Kolpackov [mailto:boris at codesynthesis.com]
> Sent: Monday, February 27, 2012 8:38 AM
> To: Stath, Paul
> Cc: odb-users at codesynthesis.com
> Subject: Re: [odb-users] Generate DDL and DML methods in separate
> output files.
> Hi Paul,
> Stath, Paul <pstath at axxcelera.com> writes:
> > Separate the DDL and DML methods generated by ODB into separate
> > modules.
> Yes, I agree this can be useful, especially for embedded systems. I
> believe just generating the implementation of the create_schema()
> functions and the catalog registration code into a separate source
> file (e.g., foo-schema.cxx or foo-odb-schema.cxx) will do the trick
> here. Do you see any issues with this approach in your use-case?
> We are planning to build a beta for the upcoming 1.9.0 release later
> in the week. If you are interested, I could implement this feature
> before then so that you could give it a try.
> BTW, another option to handle this would be to generate the schema
> as a separate SQL file (--schema-format sql). Then you could use
> the sqlite3 driver to initialize the database, for example:
> sqlite3 foo.db '.read foo.sql'
More information about the odb-users