[odb-users] Relationships and constraints without pointers

Troy Heron troy.heron at hixxy.org
Thu Jan 31 00:48:38 EST 2019


Thank you. Do you know when the new version will be ready for release?

On Wed, 23 Jan 2019 at 23:21, Boris Kolpackov <boris at codesynthesis.com>
wrote:

> Troy Heron <troy.heron at hixxy.org> writes:
>
> > struct Object1
> > {
> >     std::set<std::string> values;
> > };
> >
> > struct Object2
> > {
> >     std::set<std::string> values;
> > };
> >
> > Is it possible for me to create a relationship and constraints using
> > pragmas and no additional objects or pointers [...]
>
> In 2.5.0[1] there is the new points_to pragma for that. For example:
>
> struct Object1
> {
>    #pragma db points_to(Object2)
>    std::string value;
> };
>
> It does not yet support containers of pointers, however.
>
>
> > [...] such that the values in Object2::values can only be those in
> > Object1::values and that Object2::values is updated when a value is
> > removed from Object1::values or when the value is changed?
>
> I assume you are alluding to the ON DELETE/ON UPDATE mechanism. There
> is the on_delete pragma but there is no on_update.
>
>
> [1] https://codesynthesis.com/products/odb/doc/install-build2.xhtml
>


More information about the odb-users mailing list