[odb-users] Problems with foreign key constraints when erasing

Troy Heron troy.heron at hixxy.org
Sat Nov 30 00:27:12 EST 2013


Hello,

I'm investigating using ODB with SQLite for a project, but have hit a bit
of a wall as far as managing the erasure of objects.

It seems when building more complex relationships, erasure doesn't work so
well. Is the only way to deal with erasing these objects is to manually
delete each one back to the final reference with no cascade at all? This
seems very broken.

I've already read this post from 2011:
http://www.codesynthesis.com/pipermail/odb-users/2011-August/000267.html

Here it is suggested that you could enable cascade on delete using ALTER
TABLE. This isn't at all possible with SQLite.

Unfortunately the problem of erasing the hierarchy of objects I have
planned is too complex for the manual approach and it seems to me that I
will be unable to make use of ODB unless there is something I'm missing or
something that has changed so I can enable cascade on delete at the schema
generation stage.

There also appears to be no other alternatives other than manual SQL around
(or light wrappers over manual SQL).

Thanks,
Troy Heron


More information about the odb-users mailing list