From garthponty at gmail.com Sun Mar 2 14:34:19 2014 From: garthponty at gmail.com (Garth Ponty) Date: Mon Mar 3 01:30:25 2014 Subject: [odb-users] Unable to configure libodb-mysql-2.3.0 Message-ID: Hello, Can you please help me with the following. I have installed mysql on windows 7 64 bit I don't use VC or mingw but have opted to follow the instructions for mingw to install odb I am able to configure, make, make install libodb-2-3-0 using mingw. But when attempting to configure libodb-mysql-2.3.0 it fails checking for libmysqlclient_r... no configure: error: libmysqlclient_r is not found; consider using CPPFLAGS/LDFLAGS to specify its location Looking at the config file its says it was unable to find mysql.h I suspect mingw doesn't know where mysql client header and library files are. They are found in C:\Program Files\MySQL\MySQL Server 5.6 I have renamed libmysql.lib to libmysqlclient_r.a What is the syntax to ./configure to point it in the right direction ? This didn't work $ ./configure CPPFLAGS="-I C:\Program Files\MySQL\MySQL Server 5.6\include" LDF LAGS="-L C:\Program Files\MySQL\MySQL Server 5.6\lib" I was unable to find any helpful documentation to assist me with this problem. Thanks Garth From boris at codesynthesis.com Mon Mar 3 05:12:02 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Mar 3 05:15:12 2014 Subject: [odb-users] Unable to configure libodb-mysql-2.3.0 In-Reply-To: References: Message-ID: Hi Garth, Garth Ponty writes: > Looking at the config file its says it was unable to find mysql.h > > $ ./configure CPPFLAGS="-I C:\Program Files\MySQL\MySQL Server 5.6\include" > LDFLAGS="-L C:\Program Files\MySQL\MySQL Server 5.6\lib" I am pretty sure your problems come from spaces in the paths. While there is probably a may to make it work with the right combination of " and ', what I suggest you do is create the c:\mysql-client directory and copy the above include and lib directories there. Then try (from the MinGW shell): ./configure CPPFLAGS=-I/c/mysql-client/include LDFLAGS=-L/c/mysql-client/lib Boris From boris at codesynthesis.com Mon Mar 3 07:52:34 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Mon Mar 3 07:55:45 2014 Subject: [odb-users] Parsing error in options-file? In-Reply-To: <530F56040200004C000B1E4A@gwia.im.jku.at> References: <530F56040200004C000B1E4A@gwia.im.jku.at> Message-ID: Hi Harald, Harald Frostel writes: > It seems that options in the file, that use only one dash (e.g. -v or -d) > are simply ignored. The -v option can only be specified on the command line. However, I just tried -d and -q and they appear to work fine, at least on GNU/Linux. My test options file looks like this: -d mysql -q What does your options file look like? Boris From Harald.Frostel at jku.at Mon Mar 3 10:45:11 2014 From: Harald.Frostel at jku.at (Harald Frostel) Date: Mon Mar 3 10:45:31 2014 Subject: [odb-users] Parsing error in options-file? In-Reply-To: References: <530F56040200004C000B1E4A@gwia.im.jku.at> Message-ID: <5314B1970200004C000B219E@gwia.im.jku.at> Hi Boris, try these commands. They produce different results (same on Linux and Windows). The first one does not generate the sqlite files. odb --options-file test.options model.hxx with test.options: -m dynamic -d common -d sqlite vs. odb -m dynamic -d common -d sqlite model.hxx Regards, Harald **************************************************** Dipl.-Ing. Harald Frostel Department of Computational Perception Johannes Kepler University Linz Altenberger Strasse 69 A-4040 Linz, Austria Tel: +43 732 2468 1521 Fax: +43 732 2468 1520 Mail: harald.frostel@jku.at http://www.cp.jku.at/people/frostel **************************************************** >>> Boris Kolpackov 03.03.2014 13:52 >>> Hi Harald, Harald Frostel writes: > It seems that options in the file, that use only one dash (e.g. -v or -d) > are simply ignored. The -v option can only be specified on the command line. However, I just tried -d and -q and they appear to work fine, at least on GNU/Linux. My test options file looks like this: -d mysql -q What does your options file look like? Boris From garthponty at gmail.com Tue Mar 4 02:30:31 2014 From: garthponty at gmail.com (Garth Ponty) Date: Tue Mar 4 04:18:26 2014 Subject: [odb-users] Unable to configure libodb-mysql-2.3.0 In-Reply-To: References: Message-ID: Thanks Boris, I ended up pursing the Visual Studios route and have compiled them successfully there. On Mon, Mar 3, 2014 at 12:12 PM, Boris Kolpackov wrote: > Hi Garth, > > Garth Ponty writes: > > > Looking at the config file its says it was unable to find mysql.h > > > > $ ./configure CPPFLAGS="-I C:\Program Files\MySQL\MySQL Server > 5.6\include" > > LDFLAGS="-L C:\Program Files\MySQL\MySQL Server 5.6\lib" > > I am pretty sure your problems come from spaces in the paths. While > there is probably a may to make it work with the right combination > of " and ', what I suggest you do is create the c:\mysql-client > directory and copy the above include and lib directories there. > Then try (from the MinGW shell): > > ./configure CPPFLAGS=-I/c/mysql-client/include > LDFLAGS=-L/c/mysql-client/lib > > Boris > From boris at codesynthesis.com Tue Mar 4 06:10:19 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Mar 4 06:13:30 2014 Subject: [odb-users] Parsing error in options-file? In-Reply-To: <5314B1970200004C000B219E@gwia.im.jku.at> References: <530F56040200004C000B1E4A@gwia.im.jku.at> <5314B1970200004C000B219E@gwia.im.jku.at> Message-ID: Hi Harald, Thanks for the test case. The bug is actually in the interaction of multi-database support and specifying of databases in an options file (with -d or --database). I have fixed it for the next release: http://scm.codesynthesis.com/?p=odb/odb.git;a=commit;h=ba2b1039c37e3a18589f78c1508fd503be70b262 Thanks for reporting this! Boris From feisal.ahmad at ps-tech.com Thu Mar 13 16:50:19 2014 From: feisal.ahmad at ps-tech.com (Feisal Ahmad) Date: Thu Mar 13 16:50:30 2014 Subject: [odb-users] Constructing native queries without a where clause fails (sqlite) Message-ID: <53221A0B.4080601@ps-tech.com> Hello all, I've been trying to implement the following query type to work, without success: SELECT * FROM table LIMIT 10 OFFSET 10; This is what my relevant code looks like to construct the query statically for sqlite only: typedef odb::result result; typedef odb::query query; std::vector out; try { boost::shared_ptr t = beginTransaction(); if(m_db->id() == odb::id_sqlite) { // Sqlite LIMIT clause implementation typedef odb::sqlite::query sq_query; odb::sqlite::database& sq_db (static_cast (*m_db)); sq_query selectAll; result r = m_db->query(selectAll + " LIMIT " + sq_query::_val(maxResults) + " OFFSET " + sq_query::_val(first)); for (result::iterator i (r.begin ()); i != r.end (); ++i) { out.push_back(*i); } } else { ... } t->commit(); return out; } catch(odb::exception& e) { std::cerr << "Exception: " << e.what() << std::endl; throw; } The following exception is thrown when the query is made: 1: near "LIMIT": syntax error If I add a clause to the query, such as id > 0, the limit clause works fine... Does anyone have an idea what is going wrong, and how I can fix this? Also, any help on converting the constructed query to a string for debugging would be very welcome. Greetings, Feisal From erezgb at walla.com Thu Mar 13 11:59:47 2014 From: erezgb at walla.com (=?UTF-8?Q?=45=72=65=7A=20=47=42?=) Date: Fri Mar 14 01:17:55 2014 Subject: [odb-users] Compiling ODB with /MTd Message-ID: <1394726386.909000-83024100-30635@walla.com>


Hi Boris,


The libodb-sqlite-vc11 project you provide is compiling /MDd in debug (linking to DLL), however our program is compiling /MTd (statically linked).


Although the libodb-sqlite-vc11 does compile  /MTd, when executing an erase query on our program we get debug heap corruption assert, this seems to be related to the std::string destructor.


We tried several compilations options and the problem seems to be exclusively related to libodb-sqlite-vc11, meaning regardless of the compiling options to ODB and SQLite, when the libodb-sqlite-vc11 setting change to /MTd the problem happens.


When both the app and the libodb-sqlite-vc11 are compiled /MDd, everything works fine, the erase query is executed and the recordes are erased.


Can you please take a look ?


Thank you,

Erez.



Sample code :


unsigned long long access::object_traits_impl< ::CIndividualFactMainData, id_sqlite >::

erase_query (database&, const query_base_type& q)

  {

    using namespace sqlite;


    sqlite::connection& conn (

      sqlite::transaction::current ().connection ());


    std::string text (erase_query_statement);

    if (!q.empty ())

    {

      text += ' ';

      text += q.clause (); <-------------------problem happens here

    }


    q.init_parameters ();

    delete_statement st (

      conn,

      text,

      q.parameters_binding ());


    return st.execute ();

  }


Stack Calls :


> SQLite_Test_1.exe!_free_dbg_nolock(void * pUserData, int nBlockUse) Line 1424 C++

  SQLite_Test_1.exe!_free_dbg(void * pUserData, int nBlockUse) Line 1265 C++

  SQLite_Test_1.exe!operator delete(void * pUserData) Line 54 C++

  SQLite_Test_1.exe!std::allocator<std::_Container_proxy>::deallocate(std::_Container_proxy * _Ptr, unsigned int __formal) Line 586 C++

  SQLite_Test_1.exe!std::_String_alloc<0,std::_String_base_types<char,std::allocator<char> > >::_Free_proxy() Line 683 C++

  SQLite_Test_1.exe!std::_String_alloc<0,std::_String_base_types<char,std::allocator<char> > >::~_String_alloc<0,std::_String_base_types<char,std::allocator<char> > >() Line 656 C++

  SQLite_Test_1.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::~basic_string<char,std::char_traits<char>,std::allocator<char> >() Line 965 C++

  SQLite_Test_1.exe!odb::access::object_traits_impl<CIndividualFactMainData,1>::erase_query(odb::database & __formal, const odb::sqlite::query_base & q) Line 1348 C++

  SQLite_Test_1.exe!odb::database::erase_query<CIndividualFactMainData>(const odb::query<CIndividualFactMainData,odb::sqlite::query_base> & q) Line 470 C++

  SQLite_Test_1.exe!CIndividualFactsMgr::RemoveFacts(long individualId, const char * factToken, const char * type) Line 179 C++

  SQLite_Test_1.exe!main(int argc, char * * argv) Line 189 C++

  SQLite_Test_1.exe!__tmainCRTStartup() Line 240 C

  SQLite_Test_1.exe!mainCRTStartup() Line 164 C

  kernel32.dll!7614495d() Unknown

  [Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]

  ntdll.dll!770298ee() Unknown

  ntdll.dll!770298c4() Unknown



From boris at codesynthesis.com Fri Mar 14 09:09:33 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Mar 14 09:12:55 2014 Subject: [odb-users] Constructing native queries without a where clause fails (sqlite) In-Reply-To: <53221A0B.4080601@ps-tech.com> References: <53221A0B.4080601@ps-tech.com> Message-ID: Hi Feisal, Feisal Ahmad writes: > sq_query selectAll; > result r = m_db->query(selectAll + " LIMIT " + > sq_query::_val(maxResults) + " OFFSET " + sq_query::_val(first)); We are not recognizing LIMIT and OFFSET as special prefixes yet (on the TODO list though) so what you can do for now is this: sq_query selectAll (true); result r = m_db->query(selectAll + " LIMIT " + sq_query::_val(maxResults) + " OFFSET " + sq_query::_val(first)); You also don't have to add spaces around LIMIT and OFFSET, ODB will do it for you. So here is how I would write this query: result r = m_db->query(sq_query(true) + "LIMIT" + sq_query::_val(maxResults) + "OFFSET" + sq_query::_val(first)); > Also, any help on converting the constructed query to a string for > debugging would be very welcome. You can get the WHERE clause (and the rest) using the clause() function: sq_query q (sq_query(true) + "LIMIT" + sq_query::_val(maxResults) + "OFFSET" + sq_query::_val(first)); cerr << q.clause () << endl; If you want to see the whole statement, then statement tracing is probably the most convenient way: t.trace (odb::stderr_tracer); Boris From boris at codesynthesis.com Fri Mar 14 09:27:27 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Mar 14 09:30:49 2014 Subject: [odb-users] Compiling ODB with /MTd In-Reply-To: <1394726386.909000-83024100-30635@walla.com> References: <1394726386.909000-83024100-30635@walla.com> Message-ID: Hi Erez, Erez GB writes: > The libodb-sqlite-vc11 project you provide is compiling /MDd in > debug (linking to DLL), however our program is compiling /MTd > (statically linked). > > Although the libodb-sqlite-vc11 does compile /MTd, when executing > an erase query on our program we get debug heap corruption assert, > this seems to be related to the std::string destructor. I assume you are still linking to libodb-sqlite DLL. If that's the case, then what you have is your application and libodb-sqlite (and libodb) all using their own copy of the C runtime heap. As a result, when code in, say, libodb-sqlite returns std::string to your application code that is later release there, your application will try to free the memory that was allocated on libodb-sqlite's heap as if it were allocated on your application's heap. That obviously doesn't end well. If you want to use /MTd, all of your application should be statically linked, including libodb and libodb-sqlite. There are no static library configurations in ODB project files yet so you will have to create them yourself (shouldn't be too difficult). Boris From feisal.ahmad at ps-tech.com Mon Mar 17 10:49:58 2014 From: feisal.ahmad at ps-tech.com (Feisal Ahmad) Date: Mon Mar 17 10:50:08 2014 Subject: [odb-users] Constructing native queries without a where clause fails (sqlite) In-Reply-To: References: <53221A0B.4080601@ps-tech.com> Message-ID: <53270B96.102@ps-tech.com> Hi Boris, Thanks, that did the trick. By the way, the reason I asked about printing the query is that statement tracing didn't show the final statement as an exception is thrown already. I found the clause function going through the source code, but I couldn't find the point where the full query is put together (specifically I was interested in the list of columns of the SELECT). Feisal On 3/14/2014 8:09, Boris Kolpackov wrote: > Hi Feisal, > > Feisal Ahmad writes: > >> sq_query selectAll; >> result r = m_db->query(selectAll + " LIMIT " + >> sq_query::_val(maxResults) + " OFFSET " + sq_query::_val(first)); > > We are not recognizing LIMIT and OFFSET as special prefixes yet > (on the TODO list though) so what you can do for now is this: > > sq_query selectAll (true); > result r = m_db->query(selectAll + " LIMIT " + > sq_query::_val(maxResults) + " OFFSET " + sq_query::_val(first)); > > You also don't have to add spaces around LIMIT and OFFSET, ODB will > do it for you. So here is how I would write this query: > > result r = m_db->query(sq_query(true) + > "LIMIT" + sq_query::_val(maxResults) + > "OFFSET" + sq_query::_val(first)); > > >> Also, any help on converting the constructed query to a string for >> debugging would be very welcome. > > You can get the WHERE clause (and the rest) using the clause() > function: > > sq_query q (sq_query(true) + > "LIMIT" + sq_query::_val(maxResults) + > "OFFSET" + sq_query::_val(first)); > > cerr << q.clause () << endl; > > If you want to see the whole statement, then statement tracing > is probably the most convenient way: > > t.trace (odb::stderr_tracer); > > Boris > From boris at codesynthesis.com Tue Mar 18 04:29:14 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Mar 18 04:32:36 2014 Subject: [odb-users] Constructing native queries without a where clause fails (sqlite) In-Reply-To: <53270B96.102@ps-tech.com> References: <53221A0B.4080601@ps-tech.com> <53270B96.102@ps-tech.com> Message-ID: Hi Feisal, Feisal Ahmad writes: > By the way, the reason I asked about printing the query is that > statement tracing didn't show the final statement as an exception is > thrown already. I found the clause function going through the source > code, but I couldn't find the point where the full query is put > together (specifically I was interested in the list of columns of > the SELECT). Yes, the exception is thrown during the statement preparation which is not traced by odb::stderr_tracer. But you can create your own tracer implementation that would show statement preparations. See Section 3.13, "Tracing SQL Statement Execution" in the ODB manual. Boris From lemonnierk at ulrar.net Tue Mar 18 05:55:49 2014 From: lemonnierk at ulrar.net (lemonnierk@ulrar.net) Date: Tue Mar 18 05:55:59 2014 Subject: [odb-users] create_schema - compile error Message-ID: <20140318095549.GZ19831@luwin.ulrar.net> Hi, I started looking into odb a few days ago, and I decided to give it a try. I used the binary packages on the download page to install it. I am trying to use SQlite. When I try to use the function schema_catalog::create_schema(db) as seen in the examples, I get this In file included from /devdir/main.cpp:26:0: /usr/local/include/odb/schema-catalog.hxx: In static member function ?static void odb::schema_catalog::data_migration_function(odb::database&, odb::schema_catalog::data_migration_function_type, const string&)?: /usr/local/include/odb/schema-catalog.hxx:105:43: error: invalid use of incomplete type ?class odb::database? In file included from /usr/local/include/odb/transaction.hxx:13:0, from /devdir/main.cpp:25: /usr/local/include/odb/forward.hxx:33:9: error: forward declaration of ?class odb::database? In file included from /devdir/main.cpp:26:0: /usr/local/include/odb/schema-catalog.hxx: In static member function ?static void odb::schema_catalog::data_migration_function(odb::database&, odb::schema_version, odb::schema_catalog::data_migration_function_type, const string&)?: /usr/local/include/odb/schema-catalog.hxx:150:34: error: invalid use of incomplete type ?class odb::database? In file included from /usr/local/include/odb/transaction.hxx:13:0, from /devdir/main.cpp:25: /usr/local/include/odb/forward.hxx:33:9: error: forward declaration of ?class odb::database? In file included from /devdir/main.cpp:26:0: /usr/local/include/odb/schema-catalog.hxx: In static member function ?static odb::schema_version odb::schema_catalog::base_version(const odb::database&, const string&)?: /usr/local/include/odb/schema-catalog.hxx:176:30: error: invalid use of incomplete type ?const class odb::database? In file included from /usr/local/include/odb/transaction.hxx:13:0, from /devdir/main.cpp:25: /usr/local/include/odb/forward.hxx:33:9: error: forward declaration of ?const class odb::database? In file included from /devdir/main.cpp:26:0: /usr/local/include/odb/schema-catalog.hxx: In static member function ?static odb::schema_version odb::schema_catalog::current_version(const odb::database&, const string&)?: /usr/local/include/odb/schema-catalog.hxx:187:33: error: invalid use of incomplete type ?const class odb::database? In file included from /usr/local/include/odb/transaction.hxx:13:0, from /devdir/main.cpp:25: /usr/local/include/odb/forward.hxx:33:9: error: forward declaration of ?const class odb::database? In file included from /devdir/main.cpp:26:0: /usr/local/include/odb/schema-catalog.hxx: In static member function ?static odb::schema_version odb::schema_catalog::next_version(const odb::database&, odb::schema_version, const string&)?: /usr/local/include/odb/schema-catalog.hxx:202:30: error: invalid use of incomplete type ?const class odb::database? In file included from /usr/local/include/odb/transaction.hxx:13:0, from /devdir/main.cpp:25: /usr/local/include/odb/forward.hxx:33:9: error: forward declaration of ?const class odb::database? In file included from /devdir/main.cpp:26:0: /usr/local/include/odb/schema-catalog.hxx:202:49: error: invalid use of incomplete type ?const class odb::database? In file included from /usr/local/include/odb/transaction.hxx:13:0, from /devdir/main.cpp:25: /usr/local/include/odb/forward.hxx:33:9: error: forward declaration of ?const class odb::database? In file included from /devdir/main.cpp:26:0: /usr/local/include/odb/schema-catalog.hxx: In static member function ?static bool odb::schema_catalog::exists(const odb::database&, const string&)?: /usr/local/include/odb/schema-catalog.hxx:218:24: error: invalid use of incomplete type ?const class odb::database? In file included from /usr/local/include/odb/transaction.hxx:13:0, from /devdir/main.cpp:25: /usr/local/include/odb/forward.hxx:33:9: error: forward declaration of ?const class odb::database? In file included from /devdir/main.cpp:31:0: /devdir/build/ClassToPersist-odb.ixx: At global scope: /devdir/build/ClassToPersist-odb.ixx:12:3: error: redefinition of ?static odb::access::object_traits::id_type odb::access::object_traits::id(const object_type&)? In file included from /devdir/build/ClassToPersist-odb.hxx:292:0, from /devdir/main.cpp:30: /devdir/build/ClassToPersist-odb.ixx:12:3: error: ?static odb::access::object_traits::id_type odb::access::object_traits::id(const object_type&)? previously defined here In file included from /devdir/main.cpp:31:0: /devdir/build/ClassToPersist-odb.ixx:19:8: error: redefinition of ?static void odb::access::object_traits::callback(odb::database&, odb::access::object_traits::object_type&, odb::callback_event)? In file included from /devdir/build/ClassToPersist-odb.hxx:292:0, from /devdir/main.cpp:30: /devdir/build/ClassToPersist-odb.ixx:19:8: error: ?static void odb::access::object_traits::callback(odb::database&, odb::access::object_traits::object_type&, odb::callback_event)? previously defined here In file included from /devdir/main.cpp:31:0: /devdir/build/ClassToPersist-odb.ixx:28:8: error: redefinition of ?static void odb::access::object_traits::callback(odb::database&, const object_type&, odb::callback_event)? In file included from /devdir/build/ClassToPersist-odb.hxx:292:0, from /devdir/main.cpp:30: /devdir/build/ClassToPersist-odb.ixx:28:8: error: ?static void odb::access::object_traits::callback(odb::database&, const object_type&, odb::callback_event)? previously defined here In file included from /devdir/main.cpp:31:0: /devdir/build/ClassToPersist-odb.ixx:43:8: error: redefinition of ?static void odb::access::object_traits_impl::erase(odb::database&, const object_type&)? In file included from /devdir/build/ClassToPersist-odb.hxx:292:0, from /devdir/main.cpp:30: /devdir/build/ClassToPersist-odb.ixx:43:8: error: ?static void odb::access::object_traits_impl::erase(odb::database&, const object_type&)? previously defined here In file included from /devdir/main.cpp:31:0: /devdir/build/ClassToPersist-odb.ixx:52:8: error: redefinition of ?static void odb::access::object_traits_impl::load_(odb::access::object_traits_impl::statements_type&, odb::access::object_traits::object_type&, bool)? In file included from /devdir/build/ClassToPersist-odb.hxx:292:0, from /devdir/main.cpp:30: /devdir/build/ClassToPersist-odb.ixx:52:8: error: ?static void odb::access::object_traits_impl::load_(odb::access::object_traits_impl::statements_type&, odb::access::object_traits::object_type&, bool)? previously defined here 72 /devdir/main.cpp: In function ?int main(int, char**)?: 73 /devdir/main.cpp:42:3: error: ?schema_catalog? has not been declared 74 make[3]: *** [CMakeFiles/testprog.dir/main.cpp.o] Error 1 75 make[3]: Leaving directory `/devdir/build' 76 make[2]: *** [CMakeFiles/testprog.dir/all] Error 2 77 make[2]: Leaving directory `/devdir/build' 78 make[1]: *** [all] Error 2 I am using a CMakeLists.txt found on github to compile both odb and Qt, worked fine until I added the schema. I saw an old mail here with, I believe, the same errors, and the answer was that it was fixed in the next version. Does the version on the website still have a bug for that ? Or am I just missing something. I do include both ClassToPersist.hpp and ClassToPersist-odb.hxx in my main.cpp file, and the -odb files are generated and compiled. Thanks -- Kevin Lemonnier PGP Fingerprint : C123 47CA 9E64 FCF0 3907 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: Digital signature Url : http://codesynthesis.com/pipermail/odb-users/attachments/20140318/2939eb13/attachment.pgp From boris at codesynthesis.com Tue Mar 18 06:55:28 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Mar 18 06:58:51 2014 Subject: [odb-users] create_schema - compile error In-Reply-To: <20140318095549.GZ19831@luwin.ulrar.net> References: <20140318095549.GZ19831@luwin.ulrar.net> Message-ID: Hi Kevin, lemonnierk@ulrar.net writes: > When I try to use the function schema_catalog::create_schema(db) as > seen in the examples, I get this > > /usr/local/include/odb/schema-catalog.hxx:105:43: error: invalid use > of incomplete type ?class odb::database? Yes, that's a missing include. I've fixed it for the next release. An easy workaround is to include before in your code (which is how it is done in all the tests/examples and is the reason we haven't picked it up). Thanks for reporting this! Boris From lemonnierk at ulrar.net Tue Mar 18 07:11:06 2014 From: lemonnierk at ulrar.net (Kevin Lemonnier) Date: Tue Mar 18 07:19:01 2014 Subject: [odb-users] create_schema - compile error In-Reply-To: References: <20140318095549.GZ19831@luwin.ulrar.net> Message-ID: <67fe715c-717b-4939-b455-5eb8ce0a0081@email.android.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Ha, I was sure I was including it in one of my headers, I guess I was wrong. Thanks a lot, it works ! - -- Kevin Lemonnier On March 18, 2014 11:55:28 AM CET, Boris Kolpackov wrote: >Hi Kevin, > >lemonnierk@ulrar.net writes: > >> When I try to use the function schema_catalog::create_schema(db) as >> seen in the examples, I get this >> >> /usr/local/include/odb/schema-catalog.hxx:105:43: error: invalid use >> of incomplete type ?class odb::database? > >Yes, that's a missing include. I've fixed it for the next release. >An easy workaround is to include before > in your code (which is how it is done in >all the tests/examples and is the reason we haven't picked it up). > >Thanks for reporting this! > >Boris -----BEGIN PGP SIGNATURE----- Version: APG v1.0.9 iQJEBAEBCAAuBQJTKCnJJxxLZXZpbiBMZW1vbm5pZXIgPGxlbW9ubmllcmtAdWxy YXIubmV0PgAKCRBHyp5k/PA5B24xD/95HDyfejqgZx9/7B15yjJyvAGR+Pv1ozXJ v7eCilj+WLrBQrSwGwny5UrsyPE/h0fbIpI4z2o5nUCBxFRhEW7C4gY8+gPpJ+Kh 7kGy+Lsch5WBwDyiWU3DJs54JewowYGfq6155pk4nadlHOI5CDJMq6KhyoulEqjH JYByXbfxfcSnz/7iHxgL3x017+Z2k2Qawz6bIo1GWiRxt/8nw9BTxgxOVmjifVTe hyIS+IaPcSTTCwHRHfKgsmUGruVo7JyA/Y+i8bfixIWaBUpXZayRhV/dV0MPE8CJ cGTo1N2HwKfhQdQdodeEdkQfwSav5g+9gPmeTHKiGIlXj/xUfXbIAIRq/vx7pvid fGjkbOyJ5Q8E3Y1pRNBSdEo97K4OKoT46lS9gFCr6u9ryvRYJXzCFuyfGiI9vLhr 2IdTW7X6w+U9kY3/840nXLeMnluskm8mvD6g3AD86vNUkr+hdr//cc3b643emBNg t/ASpgguHwPynE9gSA2R6TjV9lWbkTQbYGc+y9wGye+V+EheveuE7HDdvQ6bma0O JDqhzWoUEz6Z67ZUriKoOz4wHDA4YzodQnNUokb03wR3mOsLaN+EHEt2bdEQUtMd PtWENcmSDAiydxwY36+OeI6E3hjw5Lj5gPjZFEZMnORfOy0/S/CM1YW8/l+pynH9 rNTbJfgsaQ== =6opz -----END PGP SIGNATURE----- From dhinson at netrogenblue.com Wed Mar 19 15:54:28 2014 From: dhinson at netrogenblue.com (David Hinson) Date: Wed Mar 19 15:54:31 2014 Subject: [odb-users] Accessing bind vars from tracer Message-ID: <021701cf43ad$09fd1d60$1df75820$@netrogenblue.com> Hello, odb::tracer is useful for programmatically accessing select statements for app logging and it would be even more useful if I could log the values of the bind vars of those select statements as well. I'm aware of the pitfalls of monkeying with tracer and I'm willing to accept the risks. However my efforts are immediately thwarted by the fact that the auto_handle for MYSQL_STMT in odb::mysql::statement is declared protected, preventing my odb::tracer::execute() code from accessing the MySQL bind var info through a downcasted odb::statement. Since accessing bind var values along with their select statement seems like a perfectly reasonable thing to do I'm concluding this is an intentional roadblock. If that is the case then what is the recommended way of accessing bind var values from a tracer? Regards From dhinson at netrogenblue.com Wed Mar 19 16:12:23 2014 From: dhinson at netrogenblue.com (David Hinson) Date: Wed Mar 19 16:12:26 2014 Subject: [odb-users] Accessing bind vars from tracer In-Reply-To: <021701cf43ad$09fd1d60$1df75820$@netrogenblue.com> References: <021701cf43ad$09fd1d60$1df75820$@netrogenblue.com> Message-ID: <021f01cf43af$8a93e600$9fbbb200$@netrogenblue.com> Disregard and apologies. I just found the odb::mysql::statement::handle() accessor which I missed the first time around. -----Original Message----- From: odb-users-bounces@codesynthesis.com [mailto:odb-users-bounces@codesynthesis.com] On Behalf Of David Hinson Sent: Wednesday, March 19, 2014 3:54 PM To: odb-users@codesynthesis.com Subject: [odb-users] Accessing bind vars from tracer Hello, odb::tracer is useful for programmatically accessing select statements for app logging and it would be even more useful if I could log the values of the bind vars of those select statements as well. I'm aware of the pitfalls of monkeying with tracer and I'm willing to accept the risks. However my efforts are immediately thwarted by the fact that the auto_handle for MYSQL_STMT in odb::mysql::statement is declared protected, preventing my odb::tracer::execute() code from accessing the MySQL bind var info through a downcasted odb::statement. Since accessing bind var values along with their select statement seems like a perfectly reasonable thing to do I'm concluding this is an intentional roadblock. If that is the case then what is the recommended way of accessing bind var values from a tracer? Regards ----- No virus found in this message. Checked by AVG - www.avg.com Version: 2013.0.3462 / Virus Database: 3705/7155 - Release Date: 03/05/14 Internal Virus Database is out of date. From boris at codesynthesis.com Thu Mar 20 09:15:33 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Thu Mar 20 09:18:54 2014 Subject: [odb-users] Compiling ODB with /MTd In-Reply-To: <1395320664.484000-73662449-27915@walla.com> References: <1395320664.484000-73662449-27915@walla.com> Message-ID: Hi Erez, Please do not remove odb-users@codesynthesis.com from To/Cc. Erez GB writes: > Thank you for your reply, following your advice I changed all > projects to /MTd, changed the output lib > > and replaced the preprocessor declares to define static lib. > > > However I get many unresolved externals errors and cannot link > an use them, My guess would be that you are not building your application with LIBODB_STATIC_LIB and LIBODB_SQLITE_STATIC_LIB defines. Boris [The rest of the email follows for context.] > here are the declares I use: > > > project : libodb-vc11 > > > WIN32 > > _DEBUG > > _WINDOWS > > _USRDLL > > LIBODB_STATIC_LIB > > > > project : libodb-sqlite-vc11 > > > WIN32 > > _DEBUG > > _WINDOWS > > _USRDLL > > LIBODB_SQLITE_STATIC_LIB > > LIBODB_STATIC_LIB > > LIBODB_SQLITE_HAVE_UNLOCK_NOTIFY > > > [I tries both with and without _USRDLL] > > > (Also please note that libodb-sqlite-vc11 project is using 2 defines, one in \ > odb\details\export.hxx and the other in \odb\sqlite\details\export.hxx) > > > > Can you please see if I am missing something ? > > > Thank you, bellow I added a list of some of the errors I get. > > > Erez. > > ??????????????????????????????????????????????????????????????????????????????? > 1>Framework-static-d.lib(IndividualMainData-odb.obj) : warning LNK4217: locally > defined symbol ??1delete_statement@sqlite@odb@@UAE@XZ (public: virtual > __thiscall odb::sqlite::delete_statement::~delete_statement(void)) imported in > function "public: virtual void * __thiscall odb::sqlite::delete_statement:: > `scalar deleting destructor'(unsigned int)" (?? > _Gdelete_statement@sqlite@odb@@UAEPAXI@Z) > 1>Framework-static-d.lib(PlaceMainData-odb.obj) : warning LNK4049: locally > defined symbol ??1delete_statement@sqlite@odb@@UAE@XZ (public: virtual > __thiscall odb::sqlite::delete_statement::~delete_statement(void)) imported > 1>Framework-static-d.lib(FactMainData-odb.obj) : warning LNK4049: locally > defined symbol ??1delete_statement@sqlite@odb@@UAE@XZ (public: virtual > __thiscall odb::sqlite::delete_statement::~delete_statement(void)) imported > 1>Framework-static-d.lib(NoteMainData-odb.obj) : warning LNK4049: locally > defined symbol ??1delete_statement@sqlite@odb@@UAE@XZ (public: virtual > __thiscall odb::sqlite::delete_statement::~delete_statement(void)) imported > 1>Framework-static-d.lib(IndividualFactsMgr.obj) : error LNK2001: unresolved > external symbol "__declspec(dllimport) public: __thiscall > odb::object_not_persistent::object_not_persistent(void)" (__imp_?? > 0object_not_persistent@odb@@QAE@XZ) > 1>Framework-static-d.lib(NoteMainData-odb.obj) : error LNK2019: unresolved > external symbol "__declspec(dllimport) public: __thiscall > odb::object_not_persistent::object_not_persistent(void)" (__imp_?? > 0object_not_persistent@odb@@QAE@XZ) referenced in function "public: __thiscall > std::_Iostream_error_category::_Iostream_error_category(void)" (?? > 0_Iostream_error_category@std@@QAE@XZ) From erezgb at walla.com Thu Mar 20 09:51:42 2014 From: erezgb at walla.com (=?UTF-8?Q?=45=72=65=7A=20=47=42?=) Date: Fri Mar 21 02:38:33 2014 Subject: =?UTF-8?Q?=52=65=3A=20=52=65=3A=20=5B=6F=64=62=2D=75=73=65=72=73=5D=20=43=6F=6D=70=69=6C=69=6E=67=20=4F=44=42=20=77=69=74=68=20=2F=4D=54=64?= Message-ID: <1395323501.947000-67791451-30910@walla.com>



Hi Boris,


Indeed you were right, we needed this define in all modules using the ODB and the application itself :-)


Do we need to use these 3 defines or just the first 2 ?


LIBODB_SQLITE_STATIC_LIB

LIBODB_STATIC_LIB

LIBODB_SQLITE_HAVE_UNLOCK_NOTIFY


Thank you very much,

Erez.



????: Boris Kolpackov,
????: Re: [odb-users] Compiling ODB with /MTd

Hi Erez,

Please do not remove odb-users@codesynthesis.com from To/Cc.

Erez GB writes:

> Thank you for your reply, following your advice I changed all
> projects to /MTd, changed the output lib
>
> and replaced the preprocessor declares to define static lib.
>
>
> However I get many unresolved externals errors and cannot link
> an use them,

My guess would be that you are not building your application
with LIBODB_STATIC_LIB and LIBODB_SQLITE_STATIC_LIB defines.

Boris


[The rest of the email follows for context.]

> here are the declares I use:
>
>
> project : libodb-vc11
>
>
> WIN32
>
> _DEBUG
>
> _WINDOWS
>
> _USRDLL
>
> LIBODB_STATIC_LIB
>
>
>
> project : libodb-sqlite-vc11
>
>
> WIN32
>
> _DEBUG
>
> _WINDOWS
>
> _USRDLL
>
> LIBODB_SQLITE_STATIC_LIB
>
> LIBODB_STATIC_LIB
>
> LIBODB_SQLITE_HAVE_UNLOCK_NOTIFY
>
>
> [I tries both with and without _USRDLL]
>
>
> (Also please note that libodb-sqlite-vc11 project is using 2 defines, one in
> odbdetailsexport.hxx and the other in odbsqlitedetailsexport.hxx)
>
>
>
> Can you please see if I am missing something ?
>
>
> Thank you, bellow I added a list of some of the errors I get.
>
>
> Erez.
>
> ???????????????????????????????????????????????????????????????????????????????
> 1>Framework-static-d.lib(IndividualMainData-odb.obj) : warning LNK4217: locally
> defined symbol ??1delete_statement@sqlite@odb@@UAE@XZ (public: virtual
> __thiscall odb::sqlite::delete_statement::~delete_statement(void)) imported in
> function "public: virtual void * __thiscall odb::sqlite::delete_statement::
> `scalar deleting destructor'(unsigned int)" (??
> _Gdelete_statement@sqlite@odb@@UAEPAXI@Z)
> 1>Framework-static-d.lib(PlaceMainData-odb.obj) : warning LNK4049: locally
> defined symbol ??1delete_statement@sqlite@odb@@UAE@XZ (public: virtual
> __thiscall odb::sqlite::delete_statement::~delete_statement(void)) imported
> 1>Framework-static-d.lib(FactMainData-odb.obj) : warning LNK4049: locally
> defined symbol ??1delete_statement@sqlite@odb@@UAE@XZ (public: virtual
> __thiscall odb::sqlite::delete_statement::~delete_statement(void)) imported
> 1>Framework-static-d.lib(NoteMainData-odb.obj) : warning LNK4049: locally
> defined symbol ??1delete_statement@sqlite@odb@@UAE@XZ (public: virtual
> __thiscall odb::sqlite::delete_statement::~delete_statement(void)) imported
> 1>Framework-static-d.lib(IndividualFactsMgr.obj) : error LNK2001: unresolved
> external symbol "__declspec(dllimport) public: __thiscall
> odb::object_not_persistent::object_not_persistent(void)" (__imp_??
> 0object_not_persistent@odb@@QAE@XZ)
> 1>Framework-static-d.lib(NoteMainData-odb.obj) : error LNK2019: unresolved
> external symbol "__declspec(dllimport) public: __thiscall
> odb::object_not_persistent::object_not_persistent(void)" (__imp_??
> 0object_not_persistent@odb@@QAE@XZ) referenced in function "public: __thiscall
> std::_Iostream_error_category::_Iostream_error_category(void)" (??
> 0_Iostream_error_category@std@@QAE@XZ)


From boris at codesynthesis.com Fri Mar 21 02:36:41 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Fri Mar 21 02:40:02 2014 Subject: [odb-users] Compiling ODB with /MTd In-Reply-To: <1395323501.947000-67791451-30910@walla.com> References: <1395323501.947000-67791451-30910@walla.com> Message-ID: Hi Erez, Erez GB writes: > Do we need to use these 3 defines or just the first 2 ? You only need the *_STATIC_LIB defines. The other one is internal to libodb-sqlite. Boris From boris at codesynthesis.com Tue Mar 25 06:29:43 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Tue Mar 25 06:33:06 2014 Subject: [odb-users] Re: Questions about ODB. In-Reply-To: <4F0A8F21-935B-4D02-AADD-730930551D26@me.com> References: <4F0A8F21-935B-4D02-AADD-730930551D26@me.com> Message-ID: Hi Bruce, Bruce Cresanta writes: > I'm writing a cross platform app for Mac, iPhone, and Windows. I have > managed to compile mysqlclient 6.1.3 for iPhone after many days of trying. > Need to persist objects to MySQL via SSL and SQLite locally from iPhone AND > Mac and Windows. Can you give me any guidance if this is possible with ODB? It should be. I know a lot of people are using ODB with SQLite on iOS. So it is a matter of building the MySQL client library (note that it is the C API library that you need, not the whole "Connector" stuff). If you can do that, then I think there won't be any issues. > Seems that your database connectors may not be able to compile for the arm > architecture. I am not sure what you mean by "your database connectors". But the whole of ODB targeting SQLite has been compiled for ARM: http://wiki.codesynthesis.com/Using_ODB_on_Mobile_and_Embedded_Systems http://wiki.codesynthesis.com/Using_ODB_on_Android > Do they support bundled SSL? It is the MySQL client library that needs to be built with SSL support. See this thread for details: http://www.codesynthesis.com/pipermail/odb-users/2012-January/000425.html > Would be interested in trying to get your code to work with iPhone > if you are willing. Sure, I am happy to help where I can. One thing that I would ask though is that we take any further technical discussion over to the odb-users mailing list, which, BTW, I've CC'ed to this reply. Boris From bruce at cresanta.com Tue Mar 25 16:07:23 2014 From: bruce at cresanta.com (Bruce Cresanta) Date: Tue Mar 25 16:07:34 2014 Subject: [odb-users] Fwd: ODB and Object Versioning References: Message-ID: Boris, Found some stuff in the manual about schema migration. Still wondering about the JSON reader/writer. Bruce Begin forwarded message: > From: Bruce Cresanta > Subject: ODB and Object Versioning > Date: March 25, 2014 at 12:39:09 PM MST > To: odb-users@codesynthesis.com > > Hi Boris, > > I'm on the right channel to ask questions now. I went over the Wiki, not in depth, but covered the Hello World example. Wondered how you support schema and object versioning? Mapping between versions? I'm writing version 1.0 of my program, and all the static bindings are going to change over future releases... Would be nice to have backwards compatibility. Also, wondered if it's easy to extend the reader/writer to include JSON documents? > > Thanks, > > Bruce From bruce at cresanta.com Tue Mar 25 15:39:09 2014 From: bruce at cresanta.com (Bruce Cresanta) Date: Wed Mar 26 05:19:49 2014 Subject: [odb-users] ODB and Object Versioning Message-ID: Hi Boris, I'm on the right channel to ask questions now. I went over the Wiki, not in depth, but covered the Hello World example. Wondered how you support schema and object versioning? Mapping between versions? I'm writing version 1.0 of my program, and all the static bindings are going to change over future releases... Would be nice to have backwards compatibility. Also, wondered if it's easy to extend the reader/writer to include JSON documents? Thanks, Bruce From boris at codesynthesis.com Wed Mar 26 08:24:56 2014 From: boris at codesynthesis.com (Boris Kolpackov) Date: Wed Mar 26 08:28:18 2014 Subject: [odb-users] Fwd: ODB and Object Versioning In-Reply-To: References: Message-ID: Hi Bruce, Bruce Cresanta writes: > Still wondering about the JSON reader/writer. No support for this yet but we had a couple of such requests and are thinking of adding persistence to XML/JSON. No definite time- frame for this feature though. Boris From murray.wilson at gmail.com Wed Mar 26 08:43:37 2014 From: murray.wilson at gmail.com (Murray Wilson) Date: Wed Mar 26 08:43:45 2014 Subject: [odb-users] Re: odb-users Digest, Vol 43, Issue 8 In-Reply-To: <201403251601.s2PG0xiY009707@codesynthesis.com> References: <201403251601.s2PG0xiY009707@codesynthesis.com> Message-ID: > Seems that your database connectors may not be able to compile for the arm > architecture. We use ODB for a project that will run on an ARM based Wandboard (& x86 linux & windows) and have had no problems compiling or running on the ARM system. Currently we are using the Ubuntu 12.04 image downloaded from the Wandboard.org site and compiling it on the Wandboard itself. --Murray Wilson On Tue, Mar 25, 2014 at 12:01 PM, wrote: > Send odb-users mailing list submissions to > odb-users@codesynthesis.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://codesynthesis.com/mailman/listinfo/odb-users > or, via email, send a message with subject or body 'help' to > odb-users-request@codesynthesis.com > > You can reach the person managing the list at > odb-users-owner@codesynthesis.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of odb-users digest..." > > > Today's Topics: > > 1. Re: Questions about ODB. (Boris Kolpackov) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 25 Mar 2014 12:29:43 +0200 > From: Boris Kolpackov > Subject: [odb-users] Re: Questions about ODB. > To: Bruce Cresanta > Cc: odb-users@codesynthesis.com > Message-ID: > Content-Type: text/plain; charset=us-ascii > > Hi Bruce, > > Bruce Cresanta writes: > > > I'm writing a cross platform app for Mac, iPhone, and Windows. I have > > managed to compile mysqlclient 6.1.3 for iPhone after many days of > trying. > > Need to persist objects to MySQL via SSL and SQLite locally from iPhone > AND > > Mac and Windows. Can you give me any guidance if this is possible with > ODB? > > It should be. I know a lot of people are using ODB with SQLite on iOS. > So it is a matter of building the MySQL client library (note that it > is the C API library that you need, not the whole "Connector" stuff). > If you can do that, then I think there won't be any issues. > > > Seems that your database connectors may not be able to compile for the > arm > > architecture. > > I am not sure what you mean by "your database connectors". But the > whole of ODB targeting SQLite has been compiled for ARM: > > http://wiki.codesynthesis.com/Using_ODB_on_Mobile_and_Embedded_Systems > > http://wiki.codesynthesis.com/Using_ODB_on_Android > > > > Do they support bundled SSL? > > It is the MySQL client library that needs to be built with SSL support. > See this thread for details: > > http://www.codesynthesis.com/pipermail/odb-users/2012-January/000425.html > > > > Would be interested in trying to get your code to work with iPhone > > if you are willing. > > Sure, I am happy to help where I can. One thing that I would ask > though is that we take any further technical discussion over to > the odb-users mailing list, which, BTW, I've CC'ed to this reply. > > Boris > > > > ------------------------------ > > _______________________________________________ > odb-users mailing list > odb-users@codesynthesis.com > http://codesynthesis.com/mailman/listinfo/odb-users > > > End of odb-users Digest, Vol 43, Issue 8 > **************************************** >