[odb-users] How to build a schemaa with many .hxx files (one by
class)
David Pineda
dahalpi at gmail.com
Thu Dec 31 10:25:27 EST 2015
Hello Boris.
Thanks for your advice.
First, my file struct directory it's like:
├── esquema_sge.hxx
└── tablas
├── evento.hxx
├── lugar_evento.hxx
└── persona.hxx
I've tried different ways to do that, before your message i used
'definition' in esquema_sge.hxx
like:
..after #pragma model version ...
<code>
//Includes clases
#include "tablas/evento.hxx"
#pragma db value(evento) definition
#include "tablas/persona.hxx"
#pragma db value(persona) definition
</code>
The files by table are in folder 'tables'
Then the ODB compiler works fine (fiveme the right sql), but the g++
compiler
'g++ -std=c++11 -c esquema_sge-odb.cxx' give me a lot of errors
file:compile_error.log
So then i've tried with a test files (more simple, whitout foreign keys)
the '--at-once' option:
"shell$ odb --std c++11 -I tablas -d pgsql --generate-query
--schema-format sql --generate-schema --at-once --input-name sge_cc
esquema_sge.hxx "tablas/evento.hxx" "tablas/persona.hxx" "
Works fine and give me the correct sql, but when i compile....
Give fatal error on includes to tables --> edit mannually and add the path
'tablas'
#include "evento.hxx" ---> #include "tablas/evento.hxx"
Then i recompile again and give me some errors... see on 'test_error.log'
test files:
https://drive.google.com/file/d/0B3Hidt_-CHDHQW9wVGpNN3cxS1E/view?usp=sharing
error logs:
https://drive.google.com/file/d/0B3Hidt_-CHDHZEF5Vzd2T3k2T28/view?usp=sharing
2015-12-31 4:01 GMT-03:00 Boris Kolpackov <boris at codesynthesis.com>:
> Hi David,
>
> David Pineda <dahalpi at gmail.com> writes:
>
> > My question it's about how to work with many files (one hxx by class) and
> > call or include in the main schema.hxx file to compile with odb
>
> You can use the --at-once ODB compiler option. Search the manual for this
> option to see some examples of its usage.
>
> Boris
>
--
David A. Pineda Osorio
F:+56 9 82142267
Ingeniero Civil Electricista
Universidad de Chile
*http://www.cultura-libre.cl/ <http://www.cultura-libre.cl/>*
More information about the odb-users
mailing list