From gracjan.olbinski-ext at hexagon.com Tue Jun 3 04:07:28 2025 From: gracjan.olbinski-ext at hexagon.com (OLBINSKI Gracjan) Date: Tue Jun 3 04:16:06 2025 Subject: [odb-users] Issue wth migration of std.array newly added members Message-ID: Dear ODB Support Team, I?m experiencing a problem during schema migration involving a newly added std::array data member. Here?s the situation: 1. I have an object stored in the database under schema version 41. 2. In version 42, I introduced a new data member of type std::array, which shall be initialized to {0, 0, 0} by default. 3. During the migration process, ODB correctly creates the shadow table for the object, but it remains empty after migration. 4. When attempting to load objects from the migrated database in a debug build, the application fails with an assertion in std_array_traits.hxx:50, which checks that all array elements are properly populated from the database. 5. Due to this assertion failure, it?s not possible to manually complete the migration by inserting the missing values into the shadow table, as the application crashes (due to assertion) before any such logic can be executed. The only workaround that I can think of is execution of raw sql statement via db->execute() api to insert missing rows to shadow table. Is this a known issue, and is there a recommended approach for handling std::array additions in schema evolution? Thank you for your assistance. Best regards, Gracjan Olbinski From boris at codesynthesis.com Tue Jun 3 07:04:07 2025 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jun 3 07:04:19 2025 Subject: [odb-users] Issue wth migration of std.array newly added members In-Reply-To: References: Message-ID: OLBINSKI Gracjan writes: > 1. I have an object stored in the database under schema version 41. > > 2. In version 42, I introduced a new data member of type > std::array, which shall be initialized to {0, 0, 0} by > default. > > 3. During the migration process, ODB correctly creates the shadow > table for the object, but it remains empty after migration. > > 4. When attempting to load objects from the migrated database in a debug > build, the application fails with an assertion in > std_array_traits.hxx:50, which checks that all array elements are > properly populated from the database. > > 5. Due to this assertion failure, it?s not possible to manually complete > the migration by inserting the missing values into the shadow table, > as the application crashes (due to assertion) before any such logic > can be executed. Yes, interesting situation. In a sense, the type's invariants preclude you from "fixing up" the temporarily invalid state during the schema migration. Typically, this "absent value in the database" situation is resolved with NULL-able members. The equivalent for a container would be a container type that allows empty content. > The only workaround that I can think of is execution of raw sql statement > via db->execute() api to insert missing rows to shadow table. Yes, this is probably the simplest if not very elegant solution. Another, more elaborate, option would be to use a lazy-loaded section and put the container there: https://www.codesynthesis.com/products/odb/doc/manual.xhtml#9 The idea is to load the object but not the section, then initialize the container, manually mark the section as loaded, and update the object. You would have to keep the section around (and manually load it whenever loading the object) for as long as you support this migration step (41->42 in your case) but once that step is no longer supported, you can drop the section. From boris at codesynthesis.com Tue Jun 3 07:12:32 2025 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jun 3 07:12:45 2025 Subject: [odb-users] Utilizing MySQL Login Paths In-Reply-To: References: Message-ID: Tyler Lytle writes: > I am trying to utilize MySQL login path configurations. These are located > in the home directory of the current user in a hidden file named > .mylogin.cnf. It contains an encrypted password and a default > username/hostname. From the command-line, if I simply execute "mysql" and > it will automatically log me into MySQL without specifying a > username/password on the command-line and without a password prompt. > > Can I utilize this in any way with the MySQL ODB database class? ODB uses the libmysqlclient C library and all the database class arguments are passed essentially as-is to its function that creates the connection. So to answer your question we will need to understand whether this .mylogin.cnf file is something specific to the mysql client program or if libmysqlclient also supports using it as a source of login information. If the answer is "yes", then we would need to understand how exactly this is triggered. Maybe via a client_flags? If the answer if "no", then the only option is for you to parse this file yourself, extract all the information and pass it to the ODB database constructor. From boris at codesynthesis.com Tue Jun 3 07:21:52 2025 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jun 3 07:22:03 2025 Subject: [odb-users] Out of sync documentation In-Reply-To: References: Message-ID: Danya Patrushev writes: > There seems to be a discrepancy between the manuals regarding the > --generate-schema-only option. Fixed, thank you: https://github.com/codesynthesis-com/odb/commit/c5996c0eabad From boris at codesynthesis.com Tue Jun 3 07:25:43 2025 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jun 3 07:25:54 2025 Subject: [odb-users] response file support In-Reply-To: <1150161748617491@mail.yandex.ru> References: <1150161748617491@mail.yandex.ru> Message-ID: Danya Patrushev writes: > Is the odb compiler able to handle long lists of input files via a > response file? The odb manual mentions an "options file" but > according to the description is intended for passing compiler > options only. Yes, the options file is our rough equivalent to response files but it only allows you to specify options. There is little benefit to specifying a large number of input files to the ODB compiler since the driver will just compile them one at a time, as if you invoked ODB for each file in sequence. From danyapat at yandex.ru Tue Jun 3 08:54:49 2025 From: danyapat at yandex.ru (Danya Patrushev) Date: Tue Jun 3 08:55:09 2025 Subject: [odb-users] response file support In-Reply-To: References: <1150161748617491@mail.yandex.ru> Message-ID: On Tue, 2025-06-03 at 13:25 +0200, Boris Kolpackov wrote: > Danya Patrushev writes: > > > Is the odb compiler able to handle long lists of input files via a > > response file? The odb manual mentions an "options file" but > > according to the description is intended for passing compiler > > options only. > > Yes, the options file is our rough equivalent to response files > but it only allows you to specify options. There is little benefit > to specifying a large number of input files to the ODB compiler > since the driver will just compile them one at a time, as if you > invoked ODB for each file in sequence. According to the docs one tangible benefit is the ability to maintain a single changelog file (--at-once). Or is it possible to achieve that by specifying the same --changelog for each ODB invocation per single file? From tlytle123 at gmail.com Tue Jun 3 12:14:19 2025 From: tlytle123 at gmail.com (Tyler Lytle) Date: Wed Jun 4 05:04:18 2025 Subject: [odb-users] Utilizing MySQL Login Paths In-Reply-To: References: Message-ID: Ah, I didn't think about getting that far down into the weeds. I will do some research into it and see what I can do on my end then. I appreciate the feedback. On Tue, Jun 3, 2025 at 6:12?AM Boris Kolpackov wrote: > Tyler Lytle writes: > > > I am trying to utilize MySQL login path configurations. These are located > > in the home directory of the current user in a hidden file named > > .mylogin.cnf. It contains an encrypted password and a default > > username/hostname. From the command-line, if I simply execute "mysql" and > > it will automatically log me into MySQL without specifying a > > username/password on the command-line and without a password prompt. > > > > Can I utilize this in any way with the MySQL ODB database class? > > ODB uses the libmysqlclient C library and all the database class > arguments are passed essentially as-is to its function that creates > the connection. > > So to answer your question we will need to understand whether this > .mylogin.cnf file is something specific to the mysql client program > or if libmysqlclient also supports using it as a source of login > information. > > If the answer is "yes", then we would need to understand how exactly > this is triggered. Maybe via a client_flags? > > If the answer if "no", then the only option is for you to parse this > file yourself, extract all the information and pass it to the ODB > database constructor. > -- Tyler Lytle E-Mail: tlytle123@gmail.com From boris at codesynthesis.com Wed Jun 4 08:55:44 2025 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Jun 4 08:55:56 2025 Subject: [odb-users] response file support In-Reply-To: References: <1150161748617491@mail.yandex.ru> Message-ID: Danya Patrushev writes: > According to the docs one tangible benefit is the ability to maintain a > single changelog file (--at-once). Or is it possible to achieve that by > specifying the same --changelog for each ODB invocation per single > file? Yes, you are right, if you want a single changelog and/or single SQL file with the schema, then you need to use --at-once and specify all the input files in the same invocation. I just tried specifying the input file in the options file and it seems to work. From fasisi2003 at yahoo.com Sat Jun 7 20:20:33 2025 From: fasisi2003 at yahoo.com (Frans Indroyono) Date: Mon Jun 9 02:29:20 2025 Subject: [odb-users] Unable to compile ODB sample: hello References: Message-ID: I tried to follow the "Hello Wolrd example" as described in this URL: https://www.codesynthesis.com/products/odb/doc/manual.xhtml#2 I have installed the required dev libraries. I got an error like this: How to solve this? Thank you -- Frans Indroyono --- MiniBrain - CEO, Founder AI that thinks like you do