[odb-users] Hand coded schema

Boris Kolpackov boris at codesynthesis.com
Wed Jun 11 09:21:24 EDT 2014


Hi Bruce,

Bruce Cresanta <cresanta at me.com> writes:

> I like to write my schemas by hand.

You realize you will then have to do schema migration by hand as well
(which is a real PITA)? 


> What is the best way to do this with ODB? I have a rather large system
> that I’m designing and would like to prove it out before I worry about
> mappings and things of that nature. Any recommendations on how to learn?

I actually would strongly suggest that you start with automatic schema
generation, at least initially. This will allow you to iterate/prove
your system out much faster since you only need to focus on one thing
(object model design) instead of three things (object model, relational
model, and mapping between the two). You can always keep an eye on the
generate database schema to see if it satisfies your requirements (always
a good idea). Though ODB generates pretty idiomatic SQL (one guy from a
big shop told me their Oracle DBA was quite impressed after seeing ODB-
generated database schema).

This way you will also learn how ODB maps various C++ constructs
(containers, pointers to objects, class hierarchies, etc) to SQL so
when/if you decide to go the manual schema route, you will have a pretty
good idea how to map it back to C++ classes (I assume that's what you
meant by "leaning").

Boris



More information about the odb-users mailing list