[odb-users] database generated ID combined with manual ID in
SQLite
Vladimir Yelnikov
vyelnikov at adfsolutions.com
Mon Oct 31 11:31:43 EDT 2016
Hi Boris,
It will be nice to get pre-release build. Thank you.
Another question: will it generate proper relation records in DB for
One-to-Many relationship? It generates internal tables where object_id =
NULL without that fix.
On Wed, Oct 26, 2016 at 5:44 PM, Boris Kolpackov <boris at codesynthesis.com>
wrote:
> Hi Vladimir,
>
> Vladimir Yelnikov <vyelnikov at adfsolutions.com> writes:
>
> > The first solution I tried is using nullable IDs and rely on SQLite
> > behavior when id is NULL - id will be generated.
> >
> > struct SomeClass
> > {
> > #pragma id auto
> > odb::nullable<int> id_;
> > }
>
> Ok, I've implemented support for this (but only for SQLite). Now if you
> set id_ to NULL you will get an auto-assigned value. Otherwise, the value
> you specified will be used.
>
> I can package you a pre-release if you would like to give it a try.
>
> Boris
>
More information about the odb-users
mailing list