From stvchester at gmail.com Thu Nov 3 01:45:19 2022 From: stvchester at gmail.com (Steve Chester) Date: Thu Nov 3 09:23:35 2022 Subject: [odb-users] Error: auto_ptr is not a member of 'std' Message-ID: Hello, I am testing out the ODB using the libodb vcpkg, however I'm running into an issue when I go to compile my project in visual studio 2022. I am specifying my C++ version as C++20 and am running into errors stating that auto_ptr is not a member of std. Looking at the documentation for std::auto_ptr, it looks like it was removed in C++17. I'm assuming it is a configuration issue on my part, however I could not find anything online. Is there a preprocessor definition I can define to replace the auto_ptr with either shared_ptr or unique_ptr? Any help would be appreciated. Cheers, -Steve Chester From boris at codesynthesis.com Thu Nov 3 09:37:42 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Nov 3 09:31:42 2022 Subject: [odb-users] Error: auto_ptr is not a member of 'std' In-Reply-To: References: Message-ID: Steve Chester writes: > I am testing out the ODB using the libodb vcpkg, however I'm running into > an issue when I go to compile my project in visual studio 2022. I am > specifying my C++ version as C++20 and am running into errors stating that > auto_ptr is not a member of std. Looking at the documentation for > std::auto_ptr, it looks like it was removed in C++17. Is there a > preprocessor definition I can define to replace the auto_ptr with > either shared_ptr or unique_ptr? I am not sure how vcpkg builds ODB (or which version), but the first thing to try would be to add `--std c++11` to your ODB compiler invocation and see if that helps. If that doesn't help, you can try to get ODB via build2[1], which is known to build the runtimes[2] in the C++20 mode with Visual Studio 2022. [1] https://codesynthesis.com/products/odb/doc/install-build2.xhtml [2] https://cppget.org/?builds=libodb&cf=windows*-msvc_17** From vavp12345 at yandex.ru Mon Nov 7 02:40:11 2022 From: vavp12345 at yandex.ru (=?utf-8?B?0JDRgNGC0LXQvCDQkdCw0LHQsNC10LI=?=) Date: Mon Nov 7 06:44:20 2022 Subject: [odb-users] the same SQL query is handled differently by odb and some DBManager Message-ID: <19505101667805286@mail.yandex.ru>
OS: Ubuntu 20.04.4 LTS
package: libodb-sqlite-2.5.0
compiler: gcc 9.4.0
SQlite DB
?
this SQL query works from some dbManager (DBeaver 21.3.4)
But doesnt works from odb::database (column and table names changed to simple little names)
?
 ? ?QString s = R"(
 ? ?UPDATE "T1" SET "c1"="2"
 ? ?FROM (SELECT rowid, "c2" FROM "T2" WHERE "c2" IN (51,52) AND "c3" = 59) AS t2
 ? ?WHERE "c4" = t2.rowid
 ? ?)";
?
 ? ?dbConn.execute(s.toStdString());
?
i can do this query and it works:
WITH t2 AS (SELECT rowid FROM "T2" WHERE "c2" IN (51,52) AND "c3" = 59)
UPDATE "T1" SET "c1"="2"
WHERE "c4" IN?t2
?
but?eventually i need somethink like this, so i need to get reference to foreign table.
?
UPDATE "T1"
SET "c1"=CASE t2.c2 WHEN 51 THEN 2 WHEN 52 THEN 3 END
FROM (SELECT rowid, "c2" FROM "T2" WHERE "c2" IN (51,52) AND "c3" = 59) AS t2
WHERE "c4" = t2.rowid
?
i get an error on all of this attempts (keyword FROM in UPDATE query)
odb::sqlite::database_exception 1: near "FROM": syntax error
looks like there is some difference in the processing of SQL queries in odb and dbmanager
?
The question is:
How to ensure that you can use SQL queries that work from the database manager?
From javier.gutierrez at web.de Thu Nov 17 06:57:19 2022 From: javier.gutierrez at web.de (Javier Gutierrez) Date: Thu Nov 17 06:51:16 2022 Subject: [odb-users] libsqlite3-1.so => not found Message-ID: <002701d8fa7b$bf31c120$3d954360$@web.de> Hello Boris, Hope this mail finds you well. I am trying to install odb on a brand new Ubuntu 22.04 box. But after installation I see the libraries somehow "lose" their dependencies. Here is what I mean: For the installation I follow Installing ODB with build2 (codesynthesis.com) In the section 1.3 Building ODB Runtime Libraries, in my folder "/home/user1/odb/odb-build/libodb-gcc-11" I run the following: # bpkg build libodb-sqlite . # ldd ./libodb-sqlite-2.5.0-b.23/odb/sqlite/libodb-sqlite-2.5.0-b.23.so linux-vdso.so.1 (0x00007ffef9d66000) libodb-2.5.0-b.23.so => /home/user1/ odb/odb-build/libodb-gcc-11/libodb-2.5.0-b.23/odb/libodb-2.5.0-b.23.so (0x00007f6bd67d2000) libsqlite3-1.so => /home/user1/odb/odb-build/libodb-gcc-11/libsqlite3-3.35.5/libsqlite3/libsqli te3-1.so (0x00007f6bd661e000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6bd63e3000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6bd63c3000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6bd6199000) /lib64/ld-linux-x86-64.so.2 (0x00007f6bd6832000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6bd60b2000) Then I install: # bpkg uninstall --all -recursive After installation when I run ldd on "/home/user1/odb/odb-build/libodb-gcc-11" I see following: # ldd ./libodb-sqlite-2.5.0-b.23/odb/sqlite/libodb-sqlite-2.5.0-b.23.so linux-vdso.so.1 (0x00007ffec59a7000) libodb-2.5.0-b.23.so => not found <---------- libsqlite3-1.so => not found <---------- libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1c49194000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1c49174000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1c48f4c000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1c48e63000) /lib64/ld-linux-x86-64.so.2 (0x00007f1c49407000) Any idea why these libraries are not found any more after running the installation? How to make bpkg download other versions, e.g.: 2.5.0-b.19? NOTE: If I run "bpkg build libodb-sqlite ?sys:libsqlite3" using my installation of sqlite3 libraries, then that dependency is not "lost" but libodb-2.5.0-b.23.so is. Thanks in advance. Best regards, Javier Gutierrez From boris at codesynthesis.com Fri Nov 18 02:48:46 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Nov 18 02:42:36 2022 Subject: [odb-users] libsqlite3-1.so => not found In-Reply-To: <002701d8fa7b$bf31c120$3d954360$@web.de> References: <002701d8fa7b$bf31c120$3d954360$@web.de> Message-ID: Javier Gutierrez writes: > # bpkg uninstall --all -recursive > > After installation when I run ldd on > "/home/user1/odb/odb-build/libodb-gcc-11" I see following: > > # ldd ./libodb-sqlite-2.5.0-b.23/odb/sqlite/libodb-sqlite-2.5.0-b.23.so > > libodb-2.5.0-b.23.so => not found <---------- > > Any idea why these libraries are not found any more after running the > installation? When build2 builds executables and shared libraries, it automatically adds rpath so that you can run things in place. However, when installing, build2 automatically re-links them to get rid of rpath (since we don't want the installed binaries to contain rpath pointing to build directories). One side effect of this is that binaries that are left after the installation do not have rpath and are thus not runnable. But this can be easily corrected with an update (which will again re-link them but now with rpath): $ bpkg update --all -recursive > How to make bpkg download other versions, e.g.: 2.5.0-b.19? You can specify the version to build, for example: $ bpkg build libodb-sqlite/2.5.0-b.19 For details, see: https://build2.org/bpkg/doc/bpkg-pkg-build.xhtml From doug at donohoe.info Sun Nov 27 13:04:11 2022 From: doug at donohoe.info (Doug Donohoe) Date: Mon Nov 28 08:40:50 2022 Subject: [odb-users] Dockerized odb build Message-ID: Hi odb community: In an effort to get a multi-architecture Docker image of vcf-validator working so I could use it on my M1 Mac, I ended up building the latest odb in Docker. I thought it might be useful for this community. This is the PR: https://github.com/EBIvariation/vcf-validator/pull/221 (checkout the Dockerfile and related Makefile commands). For the purposes of this email, I created an odb branch which has an odb-only Dockerfile. Here's how to test it out. git clone git@github.com:dougdonohoe/vcf-validator.git cd vcf-validator git checkout odb REPO_NAME=my-odb make build-odb docker run -it --rm my-odb/odb:2.5.0-b.23 odb --version This should work on amd64 and arm64 architectures (e.g., old and new Macs). Thanks and hopefully this helps someone. Doug Donohoe From boris at codesynthesis.com Tue Nov 29 08:18:13 2022 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Nov 29 08:11:56 2022 Subject: [odb-users] Dockerized odb build In-Reply-To: References: Message-ID: Doug Donohoe writes: > For the purposes of this email, I created an odb branch > which has an > odb-only Dockerfile. Here's how to test it out. > > git clone git@github.com:dougdonohoe/vcf-validator.git > cd vcf-validator > git checkout odb > REPO_NAME=my-odb make build-odb > docker run -it --rm my-odb/odb:2.5.0-b.23 odb --version Sounds nice, thanks for sharing!