[odb-users] Sqlite and foreign key exception

Philipp Maluta ensoreus at mail.ru
Thu Nov 7 02:54:24 EST 2013


Privet, Boris!
Thank you for reply.
I use the following command for ODB
odb --database sqlite --generate-schema --generate-query --generate-session Note.h

In file included from /Library/Frameworks/QtCore.framework/Headers/qnamespace.h:45:0,
                 from /Library/Frameworks/QtCore.framework/Headers/qobjectdefs.h:45,
                 from /Library/Frameworks/QtCore.framework/Headers/qobject.h:47,
                 from /Library/Frameworks/QtCore.framework/Headers/qabstracteventdispatcher.h:45,
                 from /Library/Frameworks/QtCore.framework/Headers/QtCore:3,
                 from Note.h:8:
/Library/Frameworks/QtCore.framework/Headers/qglobal.h:331:6: warning: #warning "This version of Mac OS X is unsupported" [-Wcpp]
I'm using no profile(of course I prefer qt-profile but I want lo localize the bug and try to build prototype with no profiles at all)

I added a lines you provided and:
./rpersistant --create --database notes.db
forein key ...
schema created
foreign keys enabled
19: foreign key constraint failed

I’m using the Per Edin’s recommendations for ODB configuration in  .pro file.

I can send all the prototype project - it’s as simple as your samples - just a few files. If there is still lack of info, would you like to browse over the sources. I’m really need your help. Thanks.



7 нояб. 2013, в 07:53, Boris Kolpackov <boris at codesynthesis.com> написал(а):

> Hi Philipp,
> 
> Philipp Maluta <ensoreus at mail.ru> writes:
> 
> Add the following extra print statements and see what the output is.
> I suspect you get the error somewhere further down your code and not
> in this fragment:
> 
>> {
>>    connection_ptr c (db->connection ());
>>    qDebug() << "forein key ...";
>> 
>>    c->execute ("PRAGMA foreign_keys=OFF");
>> 
>>    transaction t (c->begin ());
>>    schema_catalog::create_schema (*db);
>>    t.commit ();
> 
>      qDebug() << "schema created";
> 
>>    c->execute ("PRAGMA foreign_keys=ON");
> 
>      qDebug() << "foreign keys enabled";
> 
>>  }
> 
> Can you also show the ODB command line that you use to compile your
> object model?
> 
> Boris
> 



More information about the odb-users mailing list