From boris at codesynthesis.com Thu Feb 1 04:11:16 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 1 04:01:48 2024 Subject: [odb-users] Problem with bidirectional relationship In-Reply-To: <4416DF91-49E7-4C15-9051-1729EED5BC1F@gmail.com> References: <4416DF91-49E7-4C15-9051-1729EED5BC1F@gmail.com> Message-ID: Aldo Laiseca writes: > #A.h > > class B; > > #pragma db object table(?TABLE_A?) > class A { > ... > }; > > > # B.h > > #pragma db object table(?TABLE_B") > class B { > ... > }; > > My odb scripts for these classes look like this: > > odb -I /usr/local/include -d pgsql --generate-query --odb-epilogue "#include \?B.h\"" --std c++17 A.h > odb -I /usr/local/include -d pgsql --generate-query --std c++17 B.h > > However, my script fails saying this: > > A.h:45:55: error: unable to map C++ type '::std::__new_allocator< ::odb::lazy_weak_ptr< ::B > >::value_type' used in data member ?b' to a PostgreSQL database type First thing that comes to mind is that A and B do not use std::shared_ptr as object pointer (which is a requirement to be able to use odb::lazy_{shared,weak}_ptr in object relationships). For background, see: https://www.codesynthesis.com/products/odb/doc/manual.xhtml#3.3 From boris at codesynthesis.com Thu Feb 1 04:17:20 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 1 04:07:53 2024 Subject: [odb-users] container is not saved in the database In-Reply-To: References: Message-ID: ?????? ???????? writes: > I have classes: Base, Animal, Man. Where Animal and Man are inherited from > Base(polymorphic), and Man contains the Animal array as members. > persist(Man) saves Man and the Animal array pointers, but does NOT save the > original Animal. This is the expected behavior. In general, when ODB sees an object pointer (an element of the Animal array in your case), it cannot know (without performing an expensive query) whether it is already in the database or not. So deciding whether it is and if not, performing the explicit persist is the responsibility of the user. This is discussed in the manual, specifically, in the introduction to Chapter 6, "Relationships": "An important concept to keep in mind when working with object relationships is the independence of persistent objects. In particular, when an object containing a pointer to another object is made persistent or is updated, the pointed-to object is not automatically persisted or updated. Rather, only a reference to the object (in the form of the object id) is stored for the pointed-to object in the database. The pointed-to object itself is a separate entity and should be made persistent or updated independently. By default, the same principle also applies to erasing pointed-to objects. That is, we have to make sure all the pointing objects are updated accordingly. However, in the case of erase, we can specify an alternative on-delete semantic as discussed in Section 14.4.15, "on_delete"." https://www.codesynthesis.com/products/odb/doc/manual.xhtml#6 From boris at codesynthesis.com Thu Feb 1 04:26:36 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Feb 1 04:17:10 2024 Subject: [odb-users] Inserting CLOB greater having size greater then 12288 In-Reply-To: References: Message-ID: roberto minarelli writes: > have you an update for this issue? No, I haven't had a chance to look into this and unfortunately won't be able to for the foreseeable future. > I tried to debug the callback but I couldn't step into it Try to set the breakpoint inside the callback. This should allow you to step through it without having to go through OCI code (which I assume is what's causing the difficulty). > My guess is that the callback is called three times, each of which with a > chunk of 4Kb of maximum dimension when writing > And it is called maximum three times > first time with OCI_FIRST_PIECE > second time with OCI_NEXT_PIECE > and finally with OCI_LAST_PIECE What is the size of the data you are trying to insert and will it fit into the three 4Kb chunks? Do a little bit of digging and thinking on your own, I am willing to help guide you in the right direction but "it doesn't work, help" attitude is not going to get us far with this approach. From sexymimi64 at gmail.com Sat Feb 17 07:59:40 2024 From: sexymimi64 at gmail.com (Michael Martin Moro) Date: Sat Feb 17 07:50:20 2024 Subject: [odb-users] odb compiler schema generation issue Message-ID: Hi ! I've been trying to reproduce the Hello World example, but I don't get the expected result in terms of schema. Here's the documentation I've been using: https://www.codesynthesis.com/products/odb/doc/manual.xhtml#2 It says that the following command would generate a person.xml file: odb -d mysql --generate-query --generate-schema person.hxx But it doesn't. Instead, it creates a person.sql file. Could it be that the default value for `--schema-format` is actually `sql` ? When using the --schema-format option and set it to /embedded/ or /separate/, the command no longer generates a sql file. But it doesn't generate a changelog xml file either, even if the --changelog option is explicitely specified. A person-schema.cxx file is generated as expected when the value is set to /separate./ It also seems that odb::database::schema_version() always returns 0, regardless of the value set using #pragma db version, and regardless of whether the database has already been created using odb::schema_catalog::create_schema. The result is that it's not possible to update the database schema without wiping off the entire database. Odb version is 2.5.0-b.25. Any idea what would be causing such an issue ? --- Some more details: 1) If it helps, I've also noticed that the xml changlog files actually still works in my older projects: basically, the xml changelog gets updates if it already exists, but it never gets created if it doesn't already exist. While in theory, that means I should be able to patch this issue by manually creating the first changelog, in practice I haven't been able to manually create an xml changelog that the odb compiler actually reads from. And since the odb compiler no longer generates the first iteration of that changelog, I haven't been able to use changelogs in any new project. 2) This issue is not new. I use odb on a daily basis, and I've been having issues with changelogs since summer 2022. At first I suspected something was wrong with my setup, but I've actually built odb from scratch on many virtual machines since, and this reproduces everywhere. 3) Verbose output of the odb command, trying to generate a xml changelog for the person /usr/local/bin/odb -d pgsql --generate-query --generate-schema --schema-format separate --changelog person.xml model.h -v Profile search paths: ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13 ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward ?/usr/lib/gcc/x86_64-redhat-linux/13/include ?/usr/local/include ?/usr/include Compiling model.h g++ -x c++ -std=c++98 -S -Wunknown-pragmas -Wno-deprecated -fplugin=/usr/local/bin/odb.so -v -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13 -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/include -fplugin-arg-odb-svc-path=/usr/local/include -fplugin-arg-odb-svc-path=/usr/include -DODB_COMPILER -DODB_COMPILER_VERSION=2049975 -DODB_DATABASE_PGSQL -fplugin-arg-odb-database=pgsql -fplugin-arg-odb-generate-query -fplugin-arg-odb-generate-schema -fplugin-arg-odb-schema-format=separate -fplugin-arg-odb-changelog=person.xml -fplugin-arg-odb-svc-file=model.h - Utilisation des specs internes. COLLECT_GCC=g++ OFFLOAD_TARGET_NAMES=nvptx-none OFFLOAD_TARGET_DEFAULT=1 Cible : x86_64-redhat-linux Configur? avec: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-libstdcxx-zoneinfo=/usr/share/zoneinfo --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-13.2.1-20231011/obj-x86_64-redhat-linux/isl-install --enable-offload-targets=nvptx-none --without-cuda-driver --enable-offload-defaulted --enable-gnu-indirect-function --enable-cet --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1 Mod?le de thread: posix Algorithmes de compression LTO support?s: zlib zstd gcc version 13.2.1 20231011 (Red Hat 13.2.1-4) (GCC) COLLECT_GCC_OPTIONS='-std=c++98' '-S' '-Wunknown-pragmas' '-Wno-deprecated' '-fplugin=/usr/local/bin/odb.so' '-v' '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13' '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux' '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward' '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/include' '-fplugin-arg-odb-svc-path=/usr/local/include' '-fplugin-arg-odb-svc-path=/usr/include' '-D' 'ODB_COMPILER' '-D' 'ODB_COMPILER_VERSION=2049975' '-D' 'ODB_DATABASE_PGSQL' '-fplugin-arg-odb-database=pgsql' '-fplugin-arg-odb-generate-query' '-fplugin-arg-odb-generate-schema' '-fplugin-arg-odb-schema-format=separate' '-fplugin-arg-odb-changelog=person.xml' '-fplugin-arg-odb-svc-file=model.h' '-shared-libgcc' '-mtune=generic' '-march=x86-64' ?/usr/libexec/gcc/x86_64-redhat-linux/13/cc1plus -quiet -v -iplugindir=/usr/lib/gcc/x86_64-redhat-linux/13/plugin -D_GNU_SOURCE -D ODB_COMPILER -D ODB_COMPILER_VERSION=2049975 -D ODB_DATABASE_PGSQL - -iplugindir=/usr/lib/gcc/x86_64-redhat-linux/13/plugin -quiet -dumpbase - -mtune=generic -march=x86-64 -Wunknown-pragmas -Wno-deprecated -std=c++98 -version -fplugin=/usr/local/bin/odb.so -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13 -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/include -fplugin-arg-odb-svc-path=/usr/local/include -fplugin-arg-odb-svc-path=/usr/include -fplugin-arg-odb-database=pgsql -fplugin-arg-odb-generate-query -fplugin-arg-odb-generate-schema -fplugin-arg-odb-schema-format=separate -fplugin-arg-odb-changelog=person.xml -fplugin-arg-odb-svc-file=model.h -o -.s GNU C++98 (GCC) version 13.2.1 20231011 (Red Hat 13.2.1-4) (x86_64-redhat-linux) ??????? compil? par GNU C version 13.2.1 20231011 (Red Hat 13.2.1-4), GMP version 6.2.1, MPFR version 4.2.0-p12, MPC version 1.3.1, isl version isl-0.24-GMP heuristiques GGC: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Versions of loaded plugins: ?odb: 2.5.0-b.25 le r?pertoire ??/usr/lib/gcc/x86_64-redhat-linux/13/include-fixed?? est ignor? car inexistant le r?pertoire ??/usr/lib/gcc/x86_64-redhat-linux/13/../../../../x86_64-redhat-linux/include?? est ignor? car inexistant la recherche pour #include "..." d?bute ici : la recherche pour #include <...> d?bute ici: ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13 ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward ?/usr/lib/gcc/x86_64-redhat-linux/13/include ?/usr/local/include ?/usr/include Fin de la liste de recherche. Compiler executable checksum: eec6ea8c5ebefd8c87c81ea2002f55e3 COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/13/:/usr/libexec/gcc/x86_64-redhat-linux/13/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/13/:/usr/lib/gcc/x86_64-redhat-linux/ LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/13/:/usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/13/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-std=c++98' '-S' '-Wunknown-pragmas' '-Wno-deprecated' '-fplugin=/usr/local/bin/odb.so' '-v' '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13' '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux' '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward' '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/include' '-fplugin-arg-odb-svc-path=/usr/local/include' '-fplugin-arg-odb-svc-path=/usr/include' '-D' 'ODB_COMPILER' '-D' 'ODB_COMPILER_VERSION=2049975' '-D' 'ODB_DATABASE_PGSQL' '-fplugin-arg-odb-database=pgsql' '-fplugin-arg-odb-generate-query' '-fplugin-arg-odb-generate-schema' '-fplugin-arg-odb-schema-format=separate' '-fplugin-arg-odb-changelog=person.xml' '-fplugin-arg-odb-svc-file=model.h' '-shared-libgcc' '-mtune=generic' '-march=x86-64' From sexymimi64 at gmail.com Sat Feb 17 09:19:35 2024 From: sexymimi64 at gmail.com (Michael Martin Moro) Date: Sat Feb 17 09:10:16 2024 Subject: [odb-users] Re: odb compiler schema generation issue In-Reply-To: References: Message-ID: <53a998c5-0c98-455c-a2be-63cdf1183289@gmail.com> Hi, solving my own issue. After all this time, I'm finally realizing that: #pragma db model version(x,x) Needs to be specified somewhere in order for an xml changelog to be generated. I guess I must've been including it wrong. Sorry for the distrubance. Le 17/02/2024 ? 13:59, Michael Martin Moro a ?crit?: > > Hi ! > > I've been trying to reproduce the Hello World example, but I don't get > the expected result in terms of schema. Here's the documentation I've > been using: > > https://www.codesynthesis.com/products/odb/doc/manual.xhtml#2 > > It says that the following command would generate a person.xml file: > > odb -d mysql --generate-query --generate-schema person.hxx > > But it doesn't. Instead, it creates a person.sql file. Could it be > that the default value for `--schema-format` is actually `sql` ? > > When using the --schema-format option and set it to /embedded/ or > /separate/, the command no longer generates a sql file. But it doesn't > generate a changelog xml file either, even if the --changelog option > is explicitely specified. A person-schema.cxx file is generated as > expected when the value is set to /separate./ > > It also seems that odb::database::schema_version() always returns 0, > regardless of the value set using #pragma db version, and regardless > of whether the database has already been created using > odb::schema_catalog::create_schema. The result is that it's not > possible to update the database schema without wiping off the entire > database. > > Odb version is 2.5.0-b.25. > > Any idea what would be causing such an issue ? > > --- > > Some more details: > > 1) If it helps, I've also noticed that the xml changlog files actually > still works in my older projects: basically, the xml changelog gets > updates if it already exists, but it never gets created if it doesn't > already exist. While in theory, that means I should be able to patch > this issue by manually creating the first changelog, in practice I > haven't been able to manually create an xml changelog that the odb > compiler actually reads from. And since the odb compiler no longer > generates the first iteration of that changelog, I haven't been able > to use changelogs in any new project. > > 2) This issue is not new. I use odb on a daily basis, and I've been > having issues with changelogs since summer 2022. At first I suspected > something was wrong with my setup, but I've actually built odb from > scratch on many virtual machines since, and this reproduces everywhere. > > 3) Verbose output of the odb command, trying to generate a xml > changelog for the person > > /usr/local/bin/odb -d pgsql --generate-query --generate-schema > --schema-format separate --changelog person.xml model.h -v > Profile search paths: > ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13 > ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux > ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward > ?/usr/lib/gcc/x86_64-redhat-linux/13/include > ?/usr/local/include > ?/usr/include > Compiling model.h > g++ -x c++ -std=c++98 -S -Wunknown-pragmas -Wno-deprecated > -fplugin=/usr/local/bin/odb.so -v > -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13 > -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux > -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward > -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/include > -fplugin-arg-odb-svc-path=/usr/local/include > -fplugin-arg-odb-svc-path=/usr/include -DODB_COMPILER > -DODB_COMPILER_VERSION=2049975 -DODB_DATABASE_PGSQL > -fplugin-arg-odb-database=pgsql -fplugin-arg-odb-generate-query > -fplugin-arg-odb-generate-schema > -fplugin-arg-odb-schema-format=separate > -fplugin-arg-odb-changelog=person.xml -fplugin-arg-odb-svc-file=model.h - > Utilisation des specs internes. > COLLECT_GCC=g++ > OFFLOAD_TARGET_NAMES=nvptx-none > OFFLOAD_TARGET_DEFAULT=1 > Cible : x86_64-redhat-linux > Configur? avec: ../configure --enable-bootstrap > --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,m2,lto > --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info > --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared > --enable-threads=posix --enable-checking=release --enable-multilib > --with-system-zlib --enable-__cxa_atexit > --disable-libunwind-exceptions --enable-gnu-unique-object > --enable-linker-build-id --with-gcc-major-version-only > --enable-libstdcxx-backtrace > --with-libstdcxx-zoneinfo=/usr/share/zoneinfo > --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array > --with-isl=/builddir/build/BUILD/gcc-13.2.1-20231011/obj-x86_64-redhat-linux/isl-install > --enable-offload-targets=nvptx-none --without-cuda-driver > --enable-offload-defaulted --enable-gnu-indirect-function --enable-cet > --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux > --with-build-config=bootstrap-lto --enable-link-serialization=1 > Mod?le de thread: posix > Algorithmes de compression LTO support?s: zlib zstd > gcc version 13.2.1 20231011 (Red Hat 13.2.1-4) (GCC) > COLLECT_GCC_OPTIONS='-std=c++98' '-S' '-Wunknown-pragmas' > '-Wno-deprecated' '-fplugin=/usr/local/bin/odb.so' '-v' > '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13' > '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux' > '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward' > '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/include' > '-fplugin-arg-odb-svc-path=/usr/local/include' > '-fplugin-arg-odb-svc-path=/usr/include' '-D' 'ODB_COMPILER' '-D' > 'ODB_COMPILER_VERSION=2049975' '-D' 'ODB_DATABASE_PGSQL' > '-fplugin-arg-odb-database=pgsql' '-fplugin-arg-odb-generate-query' > '-fplugin-arg-odb-generate-schema' > '-fplugin-arg-odb-schema-format=separate' > '-fplugin-arg-odb-changelog=person.xml' > '-fplugin-arg-odb-svc-file=model.h' '-shared-libgcc' '-mtune=generic' > '-march=x86-64' > ?/usr/libexec/gcc/x86_64-redhat-linux/13/cc1plus -quiet -v > -iplugindir=/usr/lib/gcc/x86_64-redhat-linux/13/plugin -D_GNU_SOURCE > -D ODB_COMPILER -D ODB_COMPILER_VERSION=2049975 -D ODB_DATABASE_PGSQL > - -iplugindir=/usr/lib/gcc/x86_64-redhat-linux/13/plugin -quiet > -dumpbase - -mtune=generic -march=x86-64 -Wunknown-pragmas > -Wno-deprecated -std=c++98 -version -fplugin=/usr/local/bin/odb.so > -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13 > -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux > -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward > -fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/include > -fplugin-arg-odb-svc-path=/usr/local/include > -fplugin-arg-odb-svc-path=/usr/include -fplugin-arg-odb-database=pgsql > -fplugin-arg-odb-generate-query -fplugin-arg-odb-generate-schema > -fplugin-arg-odb-schema-format=separate > -fplugin-arg-odb-changelog=person.xml > -fplugin-arg-odb-svc-file=model.h -o -.s > GNU C++98 (GCC) version 13.2.1 20231011 (Red Hat 13.2.1-4) > (x86_64-redhat-linux) > ??????? compil? par GNU C version 13.2.1 20231011 (Red Hat 13.2.1-4), > GMP version 6.2.1, MPFR version 4.2.0-p12, MPC version 1.3.1, isl > version isl-0.24-GMP > > heuristiques GGC: --param ggc-min-expand=100 --param > ggc-min-heapsize=131072 > Versions of loaded plugins: > ?odb: 2.5.0-b.25 > le r?pertoire ??/usr/lib/gcc/x86_64-redhat-linux/13/include-fixed?? > est ignor? car inexistant > le r?pertoire > ??/usr/lib/gcc/x86_64-redhat-linux/13/../../../../x86_64-redhat-linux/include?? > est ignor? car inexistant > la recherche pour #include "..." d?bute ici : > la recherche pour #include <...> d?bute ici: > ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13 > ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux > ?/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward > ?/usr/lib/gcc/x86_64-redhat-linux/13/include > ?/usr/local/include > ?/usr/include > Fin de la liste de recherche. > Compiler executable checksum: eec6ea8c5ebefd8c87c81ea2002f55e3 > COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/13/:/usr/libexec/gcc/x86_64-redhat-linux/13/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/13/:/usr/lib/gcc/x86_64-redhat-linux/ > LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/13/:/usr/lib/gcc/x86_64-redhat-linux/13/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/13/../../../:/lib/:/usr/lib/ > COLLECT_GCC_OPTIONS='-std=c++98' '-S' '-Wunknown-pragmas' > '-Wno-deprecated' '-fplugin=/usr/local/bin/odb.so' '-v' > '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13' > '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/x86_64-redhat-linux' > '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/../../../../include/c++/13/backward' > '-fplugin-arg-odb-svc-path=/usr/lib/gcc/x86_64-redhat-linux/13/include' > '-fplugin-arg-odb-svc-path=/usr/local/include' > '-fplugin-arg-odb-svc-path=/usr/include' '-D' 'ODB_COMPILER' '-D' > 'ODB_COMPILER_VERSION=2049975' '-D' 'ODB_DATABASE_PGSQL' > '-fplugin-arg-odb-database=pgsql' '-fplugin-arg-odb-generate-query' > '-fplugin-arg-odb-generate-schema' > '-fplugin-arg-odb-schema-format=separate' > '-fplugin-arg-odb-changelog=person.xml' > '-fplugin-arg-odb-svc-file=model.h' '-shared-libgcc' '-mtune=generic' > '-march=x86-64' > From boris at codesynthesis.com Mon Feb 19 07:25:13 2024 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Feb 19 07:15:42 2024 Subject: [odb-users] Re: odb compiler schema generation issue In-Reply-To: <53a998c5-0c98-455c-a2be-63cdf1183289@gmail.com> References: <53a998c5-0c98-455c-a2be-63cdf1183289@gmail.com> Message-ID: Michael Martin Moro writes: > After all this time, I'm finally realizing that: > > #pragma db model version(x,x) > > Needs to be specified somewhere in order for an xml changelog to be > generated. Right, this is actually documented in the manual, Section 13.1, "Object Model Version and Changelog": https://www.codesynthesis.com/products/odb/doc/manual.xhtml#13.1 "Once we specify the object model version, the ODB compiler starts tracking database schema changes in a changelog file. Changelog has an XML-based, line-oriented format. It uses XML in order to provide human readability while also facilitating, if desired, processing and analysis with custom tools. The line orientation makes it easy to review with tools like diff. The changelog is maintained by the ODB compiler. Specifically, you do not need to make any manual changes to this file. You will, however, need to keep it around from one invocation of the ODB compiler to the next. In other words, the changelog file is both the input and the output of the ODB compiler. This, for example, means that if your project's source code is stored in a version control repository, then you will most likely want to store the changelog there as well. If you delete the changelog, then any ability to do schema migration will be lost. The only operation that you may want to perform with the changelog is to review the database schema changes that resulted from the C++ object model changes. For this you can use a tool like diff or, better yet, the change review facilities offered by your revision control system. For this purpose the contents of a changelog will be self-explanatory." But I am glad you sorted yourself out.