As pointed out, there are products out there that will add or drop
constraints (by doing all the tedious table creation/rename/drop under
the covers) for SQLite. The other approach is to do what SpatiaLite
does in general -- use triggers instead of check constraints but for the
same purpose (see the triggers created by AddGreometryColumn()). SQLite
can drop and add triggers, and unlike check constraints, they can't be
turned off by a pragma. They may be less efficient, though (it would be
an interesting thing to test).
Peter
On 9/9/2012 2:19 AM, Andrea Peri wrote:
Hi,
I'm an user of sqlite with the spatial extension "spatialite".
I see the sqlite db allow to define a constraints when are in the creating
phase of the table.
But is not possible to add or drop a constraint after the table is created.
In the GIS data the availability of the constraints is a really useful
think,
but if not so smart to have they locked to the creation phase.
So it is a continuous drop and recreate the table.
This is a really time consuming work.
So I like to understand if the not availability of the
both
Alter table add constraint ... foreign key (..)
Alter table drop constraint ...
is a technology choose.
and how much complex could be to add both to the sqlite sql.
Thx,
Andrea
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users