[odb-users] multi-file schema?

Christian Sell christian at gsvitec.com
Mon Sep 21 10:48:41 EDT 2015


ok, I've gotten a litle further by adding the --at-once option to the odb
command line:
 
odb --std c++11 -x -fPIC -d sqlite --generate-query --generate-session
--generate-schema --changelog changelog --schema-format separate --schema-name
--at-once main-h
 
this does generate code for LibraryObject into the cpp and h files, and
everything is compilable. But still no tables for LibraryObject in the schema.
 
?
Chris

> Christian Sell <christian at gsvitec.com> hat am 21. September 2015 um 14:01
> geschrieben:
>
>
> Hello,
>
> I am trying to map a schema that is distributed over several header files.
> Right
> now I have one central application header which #includes a library header
> file.
> There is one class from that library header file which I want to map:
>
> main.h
> LocalObject
> #include <library.h>
> LibraryObject
>
> now, since I cannot modify the library code, I am using a pragma-only epilogue
> file, which looks like:
>
> #include "main.h"
> #include "library.h"
>
> #pragma db model version(1, 1)
> #pragma db object(LibraryObject)
> #pragma db member(LibraryObject::name)
>
>
> I am invoking odb with the following command line:
>
> odb --std c++11 -x -fPIC -d sqlite --generate-query --generate-session
> --generate-schema --changelog changelog --schema-format separate --schema-name
> flexis --odb-epilogue-file pragamafile
>
>
> as a result I get a main_odb.cpp file which #includes a non-existent
> "library_odb.h" file and an empty schema
>
> Question: does ODB support mapping classes from different headers into one
> common schema? If yes, how? What am I doing wrong?
>
> thanks,
> Christian
>


More information about the odb-users mailing list