[odb-users] query_one on postgres

Boris Kolpackov boris at codesynthesis.com
Mon Feb 6 07:17:26 EST 2017


Hi David,

david bowe <dpbowe at hotmail.com> writes:

> driver: /usr/include/odb/result.txx:20:
> typename odb::object_traits<T>::pointer_type odb::result<T>::one()
> [with T = restaurants; typename odb::object_traits<T>::pointer_type =
> restaurants*]: Assertion `++i == end ()' failed.

Are you certain the query returns a single row?


> Also, since I'm already asking, with the #pragma db id auto unsigned
> long id_; Should this automatically create public accessor functions
> or have I misinterpreted the docs?

Yes, you have. ODB does not provide such functionality (since it has
nothing to do with ORM).

Boris



More information about the odb-users mailing list