[odb-users] Generate C++ classes from a DB

Boris Kolpackov boris at codesynthesis.com
Wed Jan 29 10:59:27 EST 2014


Hi Adrien,

Adrien G <adrien_chem at hotmail.com> writes:

> Once that said, imagine you have a db with hundred of tables, its
> insane to code it by hand, for time and human errors reasons

Yes, that's the motivation. But what happens if/when the
schema changes? Do you regenerate the classes? Or update
them manually?

In other words, is this feature going to generate classes
that are the "rough draft" and the user can fill them in
with customization or are they only for "data access"
(i.e., don't have anything other than accessors and
modifiers)?

The problem with the "rough draft" approach is what
happens when the schema changes and re-generating
the classes will loose those customizations?

The problem with the "data access" approach is that
there is no logic in the classes.

Then, another question is: in what form the database
schema is passed to ODB? It can be an .sql file that
ODB has to parse (quite complex). Alternatively, ODB
(or, more likely, a separate tool) can query the
database programmatically for the schema (easier but
potentially less convenient).


> Do you have a roadmap for this feature?

Essentially, we are waiting for someone who has a good use-case and
needs this feature badly enough as to help flesh out the details
(such as the questions above) and then commit to start using the
early implementation.


> Is there any other c++ lib which supports this ?

No, not that I am aware of.

Boris



More information about the odb-users mailing list