[odb-users] Re: schema generation w sqlite?

MM finjulhich at gmail.com
Fri May 30 12:25:47 EDT 2014


On 30 May 2014 17:06, MM <finjulhich at gmail.com> wrote:

> Hello,
>
> I fail to generate a sql file with this command:
>
> odb --std c++11 -d sqlite --generate-query --generate-schema Aodb.h
>
> which returns without error message, on win7/32bit
>
>
> Aodb.h includes A.h which is the definition of class A, untouched by any
> odb.
> Aodb.h has:
>
> #ifndef A_ODB_H
> #define A_ODB_H
>
> #include <odb/core.hxx>
> #include "A.h"  /// class A and struct A_stat defined here
>
> #pragma db object(A)
> #pragma db member(A::id_) id auto
>
> #pragma db view(A_stat) object(A)
> #pragma db member(A_stat::count)     column("count(" + A::id_ + ")")
> #pragma db member(A_stat::min_age) column("min(" + A::age_ + ")")
> #pragma db member(A_stat::max_age) column("max(" + A::age_ + ")")
>
> #endif // A_ODB_H
>
> Rds,
>
> An update is I added --schema-format sql . I also added the "definition"
to the pragma which generated Aodb.sql.

Rds,


More information about the odb-users mailing list