[odb-users] database generated ID combined with manual ID in SQLite

Boris Kolpackov boris at codesynthesis.com
Wed Oct 26 10:44:55 EDT 2016


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