[odb-users] raw pointer to application's global array
Boris Kolpackov
boris at codesynthesis.com
Thu May 29 07:23:45 EDT 2014
Hi,
MM <finjulhich at gmail.com> writes:
> object actually has a couple of other members, 1 of which is
> std::string code
>
> The combination (foo_, code) is the unique identifier.
>
> Is it possible, non-intrusively, to have a auto-generated id?
ODB only supports auto-generated ids for integers (by using the
corresponding underlying database's functionality). One way to
achieve the same for a string would be to generate UUIDs on the
application side. For example, you could use the Boost.Uuid
library. In that case it might even make sense to use
boost::uuids::uuid type instead of std::string (Section 23.6 in
the ODB manual).
Boris
More information about the odb-users
mailing list