From axel50397 at gmail.com Mon Jan 20 18:23:13 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Tue Jan 21 05:31:12 2020 Subject: [odb-users] Segfault during class compilation with odb Message-ID: Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200121/1065e171/signature.pgp From axel50397 at gmail.com Tue Jan 21 06:38:48 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Tue Jan 21 07:00:11 2020 Subject: [odb-users] Re: Segfault during class compilation with odb In-Reply-To: References: Message-ID: <92c3e1df-015c-380e-5228-d74b2a17bcf5@gmail.com> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200121/35d9a025/signature-0001.pgp From boris at codesynthesis.com Tue Jan 21 06:57:51 2020 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Jan 21 07:02:58 2020 Subject: [odb-users] Segfault during class compilation with odb In-Reply-To: References: Message-ID: Adnan RIHAN writes: > I'm on MacOS Mojave, with precompiled odb-2.4.0 Can you try the latest 2.5.0 pre-release, we've fixed some similar- looking bugs there? Here are the build instructions: https://codesynthesis.com/products/odb/doc/install-build2.xhtml From axel50397 at gmail.com Tue Jan 21 20:45:01 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Wed Jan 22 07:18:55 2020 Subject: [odb-users] Segfault during class compilation with odb In-Reply-To: References: Message-ID: Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200122/5c237af9/signature.pgp From adnan at rihan.fr Fri Jan 24 10:43:32 2020 From: adnan at rihan.fr (Adnan RIHAN) Date: Mon Jan 27 08:38:10 2020 Subject: [odb-users] Include from different subfolder in *-odb.hxx files Message-ID: Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200124/f283899a/signature.pgp From axel50397 at gmail.com Sun Jan 26 07:31:42 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Mon Jan 27 08:38:30 2020 Subject: [odb-users] odb::not_in_transaction with query/query_one for test Message-ID: Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200126/859ab38c/signature.pgp From axel50397 at gmail.com Mon Jan 27 06:47:06 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Mon Jan 27 08:38:30 2020 Subject: [odb-users] Re: odb::not_in_transaction with query/query_one for test In-Reply-To: References: Message-ID: <5ffdd815-a8e0-b62a-8bb5-067676e4a2e4@gmail.com> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200127/1d636dde/signature.pgp From boris at codesynthesis.com Mon Jan 27 08:50:34 2020 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jan 27 08:55:57 2020 Subject: [odb-users] Include from different subfolder in *-odb.hxx files In-Reply-To: References: Message-ID: Adnan RIHAN writes: > Of course, the compiler has -I src/, but not necessarely -I Models/, and > instead of that, is it possible to tell `odb` to write the include in > another folder (for instance, #include "../src/Models/*", or > #include "Models/*") per file? See the --include-prefix and --include-regex[-trace] options: https://codesynthesis.com/products/odb/doc/odb.xhtml From boris at codesynthesis.com Mon Jan 27 09:01:24 2020 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jan 27 09:06:49 2020 Subject: [odb-users] Re: odb::not_in_transaction with query/query_one for test In-Reply-To: <5ffdd815-a8e0-b62a-8bb5-067676e4a2e4@gmail.com> References: <5ffdd815-a8e0-b62a-8bb5-067676e4a2e4@gmail.com> Message-ID: Adnan RIHAN writes: > Could it be because I'm compiling my app with Qt's sql module (which > includes sqlite) and libodb-sqlite (which links to build2's libsqlite3)? It could be, though I would expect linking issues, not an exception (thought who knows). One way to find out is to try it with QCoreApplication rather that QApplication (and only link QtCore). Here is code from one of ODB examples that should work: https://git.codesynthesis.com/cgit/odb/odb-examples/tree/qt/driver.cxx From axel50397 at gmail.com Mon Jan 27 09:35:22 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Tue Jan 28 07:28:55 2020 Subject: [odb-users] Include from different subfolder in *-odb.hxx files In-Reply-To: References: Message-ID: <5b8a710b-b527-1a17-c50c-e019ed498d67@gmail.com> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200127/43708d95/signature.pgp From axel50397 at gmail.com Mon Jan 27 12:33:54 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Tue Jan 28 07:28:55 2020 Subject: [odb-users] Re: odb::not_in_transaction with query/query_one for test In-Reply-To: References: <5ffdd815-a8e0-b62a-8bb5-067676e4a2e4@gmail.com> Message-ID: Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200127/8d45d0aa/signature.pgp From axel50397 at gmail.com Tue Jan 28 20:37:12 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Wed Jan 29 05:01:40 2020 Subject: [odb-users] "INSERT OR UPDATE" or equivalent Message-ID: <17581b0c-e5ce-d2f0-97b8-df4694e3cf8e@gmail.com> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200129/a26b3a95/signature.pgp From axel50397 at gmail.com Wed Jan 29 13:10:10 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Thu Jan 30 08:24:23 2020 Subject: [odb-users] Transform custom type (map) to a single value (json) Message-ID: <775898c7-8810-282b-04a3-151208eb2082@gmail.com> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200129/29a2dbb7/signature.pgp From axel50397 at gmail.com Wed Jan 29 19:58:40 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Thu Jan 30 08:24:23 2020 Subject: [odb-users] Re: Transform custom type (map) to a single value (json) In-Reply-To: <775898c7-8810-282b-04a3-151208eb2082@gmail.com> References: <775898c7-8810-282b-04a3-151208eb2082@gmail.com> Message-ID: Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200130/a8d040d5/signature.pgp From boris at codesynthesis.com Fri Jan 31 07:50:38 2020 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jan 31 07:56:15 2020 Subject: [odb-users] Re: Transform custom type (map) to a single value (json) In-Reply-To: References: <775898c7-8810-282b-04a3-151208eb2082@gmail.com> Message-ID: Adnan RIHAN writes: > Le 29/01/2020 ? 19:10, Adnan RIHAN a ?crit?: > > > Currently, I would like to transform a QMap to/from JSON when using > > ODB, being able to store an entire object (and its QMap property) to > > the same table. > > I declared `Schedule::m_times` transient, and declared a virtual > `Schedule::times` with get/set pragmas. I think it's the right way > to do it ! Yes, that's one way to do it. You could also map WorkShifts to text (if you had multiple such members the above approach could become tedious): #pragma db map type(WorkShifts) as(QString) \ to((?).toJson ()) \ from(WorkShifts::fromJson (?)) From boris at codesynthesis.com Fri Jan 31 08:00:55 2020 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Jan 31 08:06:31 2020 Subject: [odb-users] "INSERT OR UPDATE" or equivalent In-Reply-To: <17581b0c-e5ce-d2f0-97b8-df4694e3cf8e@gmail.com> References: <17581b0c-e5ce-d2f0-97b8-df4694e3cf8e@gmail.com> Message-ID: Adnan RIHAN writes: > 2) Try to load() an object by id, update() it accordigly or catch > odb::object_not_persistent them persist(). I would use find() instead of load() to avoid the exception. > It would be great if it was possible to save an object using > "INSERT OR UPDATE", or "ON DUPLICATE KEY" under the hood. Yes, this could be a useful feature (commonly referred to as "UPSERT"). However, I don't believe all the databases/versions that we support have it. Also, the semantics can get nuanced, especially if we try to emulate it for databases that don't have the native support. You can see this page for some gory details: https://wiki.postgresql.org/wiki/UPSERT From adnan at rihan.fr Fri Jan 31 21:41:51 2020 From: adnan at rihan.fr (Adnan RIHAN) Date: Sun Feb 2 02:07:33 2020 Subject: [odb-users] no viable overloaded '=' with QLazySharedPointer Message-ID: Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200201/d99e7e76/signature.pgp From axel50397 at gmail.com Fri Jan 31 10:20:00 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Sun Feb 2 02:09:24 2020 Subject: [odb-users] Re: Transform custom type (map) to a single value (json) In-Reply-To: References: <775898c7-8810-282b-04a3-151208eb2082@gmail.com> Message-ID: <7f2c9a50-502e-4d83-06b9-76b87af4130b@gmail.com> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200131/ec57a55a/signature.pgp From axel50397 at gmail.com Fri Jan 31 10:29:55 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Sun Feb 2 02:09:24 2020 Subject: [odb-users] "INSERT OR UPDATE" or equivalent In-Reply-To: References: <17581b0c-e5ce-d2f0-97b8-df4694e3cf8e@gmail.com> Message-ID: <142657fa-385f-66ae-d186-2efa97a9c960@gmail.com> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200131/992a3ccd/signature.pgp From axel50397 at gmail.com Fri Jan 31 16:25:55 2020 From: axel50397 at gmail.com (Adnan RIHAN) Date: Sun Feb 2 02:09:24 2020 Subject: [odb-users] Re: Transform custom type (map) to a single value (json) In-Reply-To: <7f2c9a50-502e-4d83-06b9-76b87af4130b@gmail.com> References: <775898c7-8810-282b-04a3-151208eb2082@gmail.com> <7f2c9a50-502e-4d83-06b9-76b87af4130b@gmail.com> Message-ID: <4b81e149-ebf6-2178-f7af-6abd029925a1@gmail.com> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: OpenPGP digital signature Url : https://codesynthesis.com/pipermail/odb-users/attachments/20200131/79907cb1/signature.pgp