On Mar 5, 2009, at 10:25 AM, BareFeet wrote: > Hi all, > >>> It is true that triggers can be used to achieve referential >>> integrity. >>> However you don't have to hand craft them. > >>> the SQLite team has already done all the work for you. The SQLite >>> source includes a program named 'genfkey' that will create the >>> triggers. > >> So the next step is probably that the SQLite engine does all that on >> its >> own, how would that be? :-) > > Good question. I'd like to know that myself. > > In the mean time, I tried genfkey. I downloaded the latest sqlite3 > command line program for Mac OS X. According to the readme: > http://www.sqlite.org/cvstrac/fileview?f=sqlite/tool/genfkey.README > I should be able to run genfkey directly from within the command line > tool, but it doesn't seem to work, as shown here: > > sqlite> select sqlite_version(); > 3.6.11 > sqlite> .genfkey > unknown command or invalid arguments: "genfkey". Enter ".help" for > help > sqlite> .genfkey --exec > unknown command or invalid arguments: "genfkey". Enter ".help" for > help > > What am I missing?
The change to add the genfkey functionality to the shell is still in cvs. It will be available as part of 3.6.12. Easiest thing might be to get the new shell.c file from cvs: http://www.sqlite.org/cvstrac/getfile?f=sqlite/src/shell.c&v=1.205 Compile it with the amalgamation source: gcc -O2 sqlite3.c shell.c -o sqlite3 Or you could get the full 3.6.11 tarball and compile the standalone version of genfkey it includes: http://www.sqlite.org/sqlite-3.6.11.tar.gz Dan. > Thanks, > Tom > BareFeet > > -- > Comparison of SQLite GUI applications: > http://www.tandb.com.au/sqlite/compare/?ml > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users