On Sun, Apr 17, 2011 at 7:23 PM, Nico Williams <n...@cryptonector.com>wrote:
> Yes. In fact, I've considered storing all the startup statements in a > table such that I could tell advanced users how to trivially find how > to setup their DBs. Of course, since there's no eval(), and that's a > good thing, they'd have to cut-n-paste or direct output to a file then > .read it. > > i once used a mechanism which could probably be useful for your case: add a table with a single dummy column. Then an after-insert trigger which performs arbitrary other stuff and then deletes all rows from the dummy table. At app startup, simply insert a row into the dummy table to activate the trigger. It's not generic enough that it will work out of the box with sqlite3 shell clients, but telling them to do "insert into app_init values(0)" if they want your app-specific logic isn't _so_ bad. i don't know, however, whether or not setting pragmas can be done from a trigger. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users