-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Yves Goergen wrote: > You can already use referential integrity with SQLite - just in a very > complicated way, using numerous handcrafted triggers. How it works is > documented somewhere in the Wiki, IIRC.
It is true that triggers can be used to achieve referential integrity. However you don't have to hand craft them. The front page of the wiki links to the document explaining it: http://www.sqlite.org/cvstrac/wiki?p=ForeignKeyTriggers But the SQLite team has already done all the work for you. The SQLite source includes a program named 'genfkey' that will create the triggers. You can simply do: genfkey ./test.db | sqlite3 ./test.db Just run it again if you change your schema and it will drop the old triggers and supply new ones (by default). This is the README: http://www.sqlite.org/cvstrac/fileview?f=sqlite/tool/genfkey.README You can find the program in the tool subdirectory if you CVS checkout the SQLite code, or grab it using a browser from: http://www.sqlite.org/cvstrac/dir?d=sqlite/tool Roger -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkmTsjEACgkQmOOfHg372QSnQQCfUTQn0DaSwplXm/Gq8lSbAoXw eU0An1ygaYUSZhtifTz37fybb+A8MbBS =EUri -----END PGP SIGNATURE----- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users