From boris at codesynthesis.com Mon May 5 09:21:57 2025 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon May 5 09:20:18 2025 Subject: [odb-users] points_to not considered as a relationship in view In-Reply-To: <275381745991679@mail.yandex.ru> References: <275381745991679@mail.yandex.ru> Message-ID: ????? ???????? writes: > The odb compiler does not seem to understand that the pragma > "points_to" represents a relationship so it complains it's "unable to > find an object relationship"? when processing db views (compare it > with relationships represented by QSharedPointer - our choice by > default). Is it a feature or missing functionality? Can you provide a minimal header that reproduces this? Potentially related to: https://github.com/codesynthesis-com/odb/issues/9 P.S.: In the future please include a meaningful subject in your posts. From danyapat at yandex.ru Tue May 6 02:14:49 2025 From: danyapat at yandex.ru (=?utf-8?B?0JTQsNC90LjQuyDQn9Cw0YLRgNGD0YjQtdCy?=) Date: Tue May 6 02:15:08 2025 Subject: [odb-users] points_to not considered as a relationship in view In-Reply-To: References: <275381745991679@mail.yandex.ru> Message-ID: <233201746512063@mail.yandex.ru>
?
?
----------------
????: ????? ???????? (danyapat@yandex.ru);
?????: odb-users@codesynthesis.com;
????: [odb-users] points_to not considered as a relationship in view;
05.05.2025, 18:20, "Boris Kolpackov" <boris@codesynthesis.com>:

????? ???????? <danyapat@yandex.ru> writes:
?

????The odb compiler does not seem to understand that the pragma
????"points_to" represents a relationship so it complains it's "unable to
????find an object relationship"? when processing db views (compare it
????with relationships represented by QSharedPointer - our choice by
????default). Is it a feature or missing functionality?


Can you provide a minimal header that reproduces this?

Potentially related to:

https://github.com/codesynthesis-com/odb/issues/9

P.S.: In the future please include a meaningful subject in your posts.

-------------- next part -------------- A non-text attachment was scrubbed... Name: test.h Type: text/x-c Size: 321 bytes Desc: not available Url : https://codesynthesis.com/pipermail/odb-users/attachments/20250506/22939b87/test.bin From richard.oehlinger at adbsafegate.com Tue May 13 02:48:30 2025 From: richard.oehlinger at adbsafegate.com (Richard Oehlinger) Date: Tue May 20 07:14:31 2025 Subject: [odb-users] ODB compiler generates "-.s" file Message-ID: Every time we run the ODB compiler v2.5.0 but I've seen it with v2.4.0 aswell. it seems to be generating a `-.s`-file with one line of content: ` .file ""` This is mildly annoying because its next to the source code and pollutes our source checkout. We have only seen this on our RHEL8 which using stock GCC 8.5 and your ODB binaries. As far as I remember this was not an issue on our CentOS 7, but we have retired that, so I cannot check. BR Richard From boris at codesynthesis.com Tue May 20 07:13:30 2025 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue May 20 07:14:31 2025 Subject: [odb-users] points_to not considered as a relationship in view In-Reply-To: <233201746512063@mail.yandex.ru> References: <275381745991679@mail.yandex.ru> <233201746512063@mail.yandex.ru> Message-ID: Thanks for the reproducer. Looks like a bug: https://github.com/codesynthesis-com/odb/issues/13 From Matthias.seiler at stadlerrail.com Tue May 13 09:37:56 2025 From: Matthias.seiler at stadlerrail.com (Seiler Matthias SIGCH) Date: Tue May 20 07:16:05 2025 Subject: [odb-users] "Access violation reading location" when querying a view Message-ID: Hi Boris, I have the following view ... ``` #pragma db view query( \ "SELECT TpEntity.Id " \ "FROM TpEntity " \ "INNER JOIN Switch " \ "ON Switch.TpEntity = TpEntity.Id " \ "WHERE (?)") struct TpEntityIdBySwitch { unsigned long tpEntityId; }; ``` ... which is queried like this: ``` transaction t(db->begin()); auto q = "Switch.Id='" + switchId + "'"; auto viewRes = *db->query_one(q); t.commit(); ``` Thus, given a `Switch.Id` (whose table has a foreign key to `TpEntity` on `Switch.TpEntity`), I want to get the value of `TpEntity.Id`. It works fine if the passed ID exists. However, if it does not, I get an "Access violation reading location ...", which I'm not able to catch. How can I go around this issue such that it does not crash, maybe getting "some" result (e.g., NULL or optional) regardless of if the table contains the ID? Kind regards, Matthias From boris at codesynthesis.com Tue May 20 07:23:24 2025 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue May 20 07:21:42 2025 Subject: [odb-users] "Access violation reading location" when querying a view In-Reply-To: References: Message-ID: Seiler Matthias SIGCH writes: > ``` > transaction t(db->begin()); > auto q = "Switch.Id='" + switchId + "'"; > auto viewRes = *db->query_one(q); > t.commit(); > ``` > > Thus, given a `Switch.Id` (whose table has a foreign key to `TpEntity` > on `Switch.TpEntity`), I want to get the value of `TpEntity.Id`. It > works fine if the passed ID exists. However, if it does not, I get > an "Access violation reading location ...", which I'm not able to > catch. How can I go around this issue such that it does not crash, > maybe getting "some" result (e.g., NULL or optional) regardless of > if the table contains the ID? query_one() return a pointer for exactly this reason (which you then unconditionally derefence). For details see: https://www.codesynthesis.com/products/odb/doc/manual.xhtml#4.3 From tlytle123 at gmail.com Wed May 28 14:23:17 2025 From: tlytle123 at gmail.com (Tyler Lytle) Date: Thu May 29 03:49:48 2025 Subject: [odb-users] Utilizing MySQL Login Paths Message-ID: Hello ODB! 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? I tried to use the constructor that takes strings and a "number of strings" argument but that doesn't seem to work. I would actually like to try to connect to MySQL without specifying anything other than the database to use. However, it looks like ODB explicitly uses the currently logged in username if no user is specified. Any help is appreciated. -- Tyler Lytle E-Mail: tlytle123@gmail.com From danyapat at yandex.ru Thu May 29 08:26:25 2025 From: danyapat at yandex.ru (Danya Patrushev) Date: Thu May 29 08:27:47 2025 Subject: [odb-users] Out of sync documentation Message-ID: There seems to be a discrepancy between the manuals regarding the -- generate-schema-only option. The odb compiler doc says: --generate-schema-only Generate only the database schema. Note that this option is only valid when generating schema as a standalone SQL file (see --schema-format for details). While the odb manual contains ?lines in chapter 13.1 Object Model Version and Changelog: The same can be achieved for the embedded schema by instructing the ODB compiler to generate the database creation code into a separate C++ file (--schema-format?separate): odb --database pgsql --generate-schema-only --schema-format separate \ --at-once --input-name company person.hxx employee.hxx employer.hxx From danyapat at yandex.ru Fri May 30 11:09:35 2025 From: danyapat at yandex.ru (Danya Patrushev) Date: Fri May 30 11:09:57 2025 Subject: [odb-users] response file support Message-ID: <1150161748617491@mail.yandex.ru> Hi. 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. Â