From boris at codesynthesis.com Mon Jun 3 09:09:21 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jun 3 09:30:30 2019 Subject: [odb-users] Problems using ODB w/SQLite on Windows In-Reply-To: References: <850824360a6e4ca482ebc6226196e84e@MLBXCH15.cs.myharris.net> <5f0649c26f8542f4b9da7784ace5889e@MLBXCH15.cs.myharris.net> <6c944e435cd64072a4ef9023a51d6522@MLBXCH15.cs.myharris.net> <579ef0ad2f294d92903279960f0d1d10@MLBXCH15.cs.myharris.net> Message-ID: Syre, William writes: > One final question, are there odb examples for odb 2.5? Not at the moment but you can re-use examples from 2.4 as described in this helpful recap by Allan Head: https://www.codesynthesis.com/pipermail/odb-users/2019-May/004256.html From boris at codesynthesis.com Mon Jun 3 09:26:49 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jun 3 09:48:00 2019 Subject: [odb-users] charset in odb In-Reply-To: References: Message-ID: Cheng Wu writes: > Can I set charset to utf8 while using odb to generate cpp code? While I don't understand what exactly you want to achieve here, the values that you send in, say, INSERT statement are not hard-coded in the generated code. Rather, they are taken from, say, std::string data member in your class. And it is your responsibility to make sure that the encoding of such a string and the way your database is created and/or opened are compatible. From sandisks555 at gmail.com Thu Jun 6 00:43:41 2019 From: sandisks555 at gmail.com (Cheng Wu) Date: Thu Jun 6 01:05:18 2019 Subject: [odb-users] charset in odb In-Reply-To: References: Message-ID: Yes?what you sad is right. I make wrong in this. Thanks. On Mon, Jun 3, 2019 at 9:26 PM Boris Kolpackov wrote: > Cheng Wu writes: > > > Can I set charset to utf8 while using odb to generate cpp code? > > While I don't understand what exactly you want to achieve here, the > values that you send in, say, INSERT statement are not hard-coded in > the generated code. Rather, they are taken from, say, std::string > data member in your class. And it is your responsibility to make > sure that the encoding of such a string and the way your database > is created and/or opened are compatible. > From d.patrushev at prosoftsystems.ru Fri Jun 7 02:49:53 2019 From: d.patrushev at prosoftsystems.ru (=?koi8-r?B?8MHU0tXbxdcg5MHOycwg4c7E0sXF18ne?=) Date: Fri Jun 7 03:11:25 2019 Subject: [odb-users] Cannot use odb because of GCC error Message-ID: <1e4bff8cf3854d5fab69a2e72bf89d3c@prosoftsystems.ru> Hi, we are facing a gcc internal compiler error when building under windows 10, Qt library involved. Here is the description of the bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923214. Odb was fetched from cppget.org and built with build2. We are looking for a way to upgrade gcc that odb uses. A patch maybe? From boris at codesynthesis.com Mon Jun 10 08:01:52 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jun 10 08:23:28 2019 Subject: [odb-users] Cannot use odb because of GCC error In-Reply-To: <1e4bff8cf3854d5fab69a2e72bf89d3c@prosoftsystems.ru> References: <1e4bff8cf3854d5fab69a2e72bf89d3c@prosoftsystems.ru> Message-ID: ???????? ????? ????????? writes: > Hi, we are facing a gcc internal compiler error when building under > windows 10, Qt library involved. Here is the description of the bug > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=923214. Odb was > fetched from cppget.org and built with build2. We are looking for > a way to upgrade gcc that odb uses. A patch maybe? This seems to have been fixed in GCC 8.4 (not yet released nor packaged by MSYS2[1]) and 9.1. After the upcoming 0.11.0 release of build2 (tomorrow, if all goes well), we will upgrade the next development series to GCC 9.1 at which point you can try build2 and ODB from stage[2] (you should also be able to take new baseutils/mingw packages and use them with the released version but that will require manual build2 installation[3]). [1] http://repo.msys2.org/mingw/x86_64/ [2] https://build2.org/community.xhtml#stage [3] https://build2.org/build2-toolchain/doc/build2-toolchain-install.xhtml From psatya551 at gmail.com Mon Jun 10 08:28:53 2019 From: psatya551 at gmail.com (satya) Date: Mon Jun 10 08:45:55 2019 Subject: [odb-users] Oracle data type SDO_GEOMETRY insertion Message-ID: Dear All, I am working with ODB ORM c++.I need help in dealing with SDO_GEOMETRY data type of oracle. I am not able to map it to SQL core type and c++ type from my c++ applicaton. Please tell me how to do it. I am struggling with this problem from past two days. Thanks & Regards Satya From heirecka at exherbo.org Fri Jun 7 08:56:24 2019 From: heirecka at exherbo.org (Heiko Becker) Date: Mon Jun 10 08:49:04 2019 Subject: [odb-users] Will the autotools build be support with >=2.5.0 Message-ID: <5fb35409-3740-4c08-86a6-a626285cd4b0@exherbo.org> Hello, I wonder if autotools based builds of odb and friends will still be supported with versions >= 2.5.0? While I understand that build2 is the new, preferred thing, it brings a lot unnecessary complexity (at least from the viewpoint of a distro packager), overlaps with the native package manager and more importantly doesn't use system libs, but installs its bundled libs instead. Especially in the case of sqlite, which seems rather old and probably vulnerable, that's not really an option. Cheers, Heiko From boris at codesynthesis.com Mon Jun 10 08:40:27 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jun 10 09:01:59 2019 Subject: [odb-users] Will the autotools build be support with >=2.5.0 In-Reply-To: <5fb35409-3740-4c08-86a6-a626285cd4b0@exherbo.org> References: <5fb35409-3740-4c08-86a6-a626285cd4b0@exherbo.org> Message-ID: Heiko Becker writes: > I wonder if autotools based builds of odb and friends will still be > supported with versions >= 2.5.0? We are still on the fence about it. The autotools (and VC project) support hasn't been removed from master but it hasn't been maintained and it's very unlikely we will have the resources (no desire, to be honest) to do this ourselves. So unless someone steps up, it's unlikely autotools support will remain. > While I understand that build2 is the new, preferred thing, it brings a lot > unnecessary complexity (at least from the viewpoint of a distro packager), > overlaps with the native package manager and more importantly doesn't use > system libs, but installs its bundled libs instead. You can use a system-installed library in place of any dependency. In fact, build2 was designed from grounds up with distribution packaging in mind and to work well with system package managers. See the following FAQ entry for details: https://build2.org/faq.xhtml#why-syspkg But if you see some problems, I would be happy to hear more and to try to address them. From boris at codesynthesis.com Mon Jun 10 09:15:02 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Jun 10 09:36:35 2019 Subject: [odb-users] Oracle data type SDO_GEOMETRY insertion In-Reply-To: References: Message-ID: satya writes: > I need help in dealing with SDO_GEOMETRY data type of oracle. I am not > able to map it to SQL core type and c++ type from my c++ applicaton. The following two articles describe the available approaches: "Extended Database to C++ Type Mapping in ODB": https://www.codesynthesis.com/~boris/blog/2012/07/18/custom-database-to-cxx-type-mapping-in-odb/ "Custom C++ to Database Type Mapping in ODB": https://www.codesynthesis.com/~boris/blog/2012/10/16/custom-cxx-to-database-type-mapping-in-odb/ There is also the oracle/custom/ test in the odb-tests package that can serve as an example. From boris at codesynthesis.com Thu Jun 13 05:08:18 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jun 13 05:30:03 2019 Subject: [odb-users] Cannot use odb because of GCC error In-Reply-To: References: <1e4bff8cf3854d5fab69a2e72bf89d3c@prosoftsystems.ru> Message-ID: Boris Kolpackov writes: > After the upcoming 0.11.0 release of build2 (tomorrow, if all goes > well), we will upgrade the next development series to GCC 9.1 at > which point you can try build2 and ODB from stage [...] GCC 9.1 is now available on stage. Can you try to get both build2 and ODB from: https://build2.org/community.xhtml#stage It's the same ODB installation instructions[1] but using the stage.build2.org repository instead of cppget.org. Just make sure you get build2 install scripts for stage. [1] https://codesynthesis.com/products/odb/doc/install-build2.xhtml From d.patrushev at prosoftsystems.ru Thu Jun 13 05:41:09 2019 From: d.patrushev at prosoftsystems.ru (=?windows-1251?B?z+Dy8PP45eIgxODt6OsgwO3k8OXl4uj3?=) Date: Thu Jun 13 06:02:58 2019 Subject: [odb-users] Cannot use odb because of GCC error In-Reply-To: References: <1e4bff8cf3854d5fab69a2e72bf89d3c@prosoftsystems.ru> , Message-ID: Thanks for the help. I successfully built build2 from stage. As for the ODB compiler, I rashly followed the usual install instructions by typing "bpkg build odb@https://pkg.cppget.org/1/beta" (not the stage repo) , but was nevertheless able to successfully build it and later use it to build our project). Is it critical that I use the odb compiler version at stage.build2.org? ? ?????????, ???????-??????????? ??? ????????-???????? ???????? ????? ????????? ________________________________________ ??: Boris Kolpackov ??????????: 13 ???? 2019 ?. 14:08 ????: ???????? ????? ????????? ?????: odb-users@codesynthesis.com ????: Re: [odb-users] Cannot use odb because of GCC error Boris Kolpackov writes: > After the upcoming 0.11.0 release of build2 (tomorrow, if all goes > well), we will upgrade the next development series to GCC 9.1 at > which point you can try build2 and ODB from stage [...] GCC 9.1 is now available on stage. Can you try to get both build2 and ODB from: https://build2.org/community.xhtml#stage It's the same ODB installation instructions[1] but using the stage.build2.org repository instead of cppget.org. Just make sure you get build2 install scripts for stage. [1] https://codesynthesis.com/products/odb/doc/install-build2.xhtml From boris at codesynthesis.com Thu Jun 13 07:33:10 2019 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Jun 13 07:54:53 2019 Subject: [odb-users] Cannot use odb because of GCC error In-Reply-To: References: <1e4bff8cf3854d5fab69a2e72bf89d3c@prosoftsystems.ru> Message-ID: ???????? ????? ????????? writes: > Is it critical that I use the odb compiler version at stage.build2.org? No, now thinking about it, there is nothing wrong with getting build2 from stage and ODB from cppget.org. From andrey.psv at gmail.com Fri Jun 28 10:12:09 2019 From: andrey.psv at gmail.com (Andrey Paraskevopulo) Date: Fri Jun 28 11:37:47 2019 Subject: [odb-users] Quering with empty string parameter error. Microsoft SQL Server Message-ID: Problem: Unable to use empty string query parameters for the VARCHAR(MAX) fields. Example: db.query(odb::query::name == "/*or std::string()*/); result: exception: COUNT field incorrect or syntax error Condition: - mssql - odb 2.4 - field type is VARCHAR(MAX) - query condition (not persist parameter) As I understand, the problem that param in statement exists("... WHERE name=?"), but the value in not binded. Possible solutions: 1. Init buffer data for the empty string with empty size (for the query param) file: query.cxx void long_query_param_impl:: copy () { ... //replace if (chunk != chunk_null) { if (buf_.capacity () < size_ + n) buf_.capacity (size_ + n, size_); memcpy (buf_.data () + size_, buf, n); size_ += n; } //with if (chunk != chunk_null) { if (n == 0) { if (buf_.capacity() == 0 && buf != nullptr) { assert(size_ == 0); buf_.capacity(size_ + 1, size_); } } else { if (buf_.capacity() < size_ + n) buf_.capacity(size_ + n, size_); memcpy(buf_.data() + size_, buf, n); size_ += n; } } Remark: solution does not affect Blob variables (they have the null buf for the empty values). May be the query problem can be reproduced for the Blobs too. 2. Disable skip empty binds (with null buffer) file: statement.cxx void statement:: bind_param (bind* b, size_t n) { SQLRETURN r; SQLUSMALLINT i (0); for (bind* end (b + n); b != end; ++b) { ->// if (b->buffer == 0) // Skip NULL entries. ->// continue; This solves the problem, but for me it hard to predict side effects. In the same time, it seems that in pgsql null entries are not skipped in the bind_param function. Andrey Paraskevopulo From 710616819 at qq.com Sun Jun 30 07:57:09 2019 From: 710616819 at qq.com (=?ISO-8859-1?B?RUxF?=) Date: Mon Jul 1 07:53:22 2019 Subject: [odb-users] Can you give me some information about building ODB compiler on Windows Message-ID: hello, I want to build 64bit ODB compiler on Windows, Can you give me more information about how to build it on Windows. thanks.