[odb-users] Generate C++ classes from sqlite database schema

Boris Kolpackov boris at codesynthesis.com
Sat Feb 7 08:36:53 EST 2015


Hi Nicholas,

Nicholas Cremonesi <nicholas.cremonesi at elicat.net> writes:

> I have to handle a huge SQLite database, I already have the database schema
> and I would to know if  it's possible, with ODB, to generate the
> corresponding C++ classes, instead of generate the schema from the classes
> as usual.

This feature is asked for from time to time and there are some ideas
floating around, but nothing has been implemented yet. It is a big
and not very well defined problem. Here is some further reading if
you are interested:

http://codesynthesis.com/pipermail/odb-users/2014-January/001769.html

In the meantime, with a bit of effort it should be possible to read
the SQLite schema (from the database) and generate ODB-persistent C++
classes. Since you only need to generate classes that fit your
specific requirements, you can sidestep a lot of the issues that
are described above and that a generic solution would face.

Boris



More information about the odb-users mailing list