[odb-users] Attempt to refer to a dbvalue inside another dbvalue - "invalid data member in db pragma column"

Артем Бабаев vavp12345 at yandex.ru
Fri Jul 22 04:25:48 EDT 2022


   OS: Ubuntu 20.04.4 LTS

   package: libodb-sqlite-2.5.0

   compiler: gcc 9.4.0

   Â

   this code does not compile:

   // experiment.h
   #include <odb/core.hxx>
   #pragma db value
   struct Val_1 { int a; };
   #pragma db value
   struct Val_2 { Val_1 val1; };
   Â
   #pragma db object
   class Object {
   Â  Â  friend odb::access;
   #pragma db id auto
   Â  Â  int id;
   Â  Â  Val_2 value;
   };
   Â
   #pragma db view object(Object)
   struct ObjectView
   {
   #pragma db column(Object::value) ///< OK
   Â  Â  Val_2 val2;
   #pragma db column(Object::value.val1.a) ///< OK
   Â  Â  int a;
   #pragma db column(Object::value.val1) ///< DONT WORK: "invalid data
   member in db pragma column"
   Â  Â  Val_1 val1;
   };


More information about the odb-users mailing list