On 15 Mar 2018, at 11:40am, Toby Dickenson <t...@tarind.com> wrote:
> But I also want to update these tables from the command line, when > these functions wont be available. Is there a way to construct the > trigger so that I get NULLs instead of errors when a custom function > doesnt exist? Or a better way to pass information into the trigger > other than functions? I can't answer your question, but if you're interested in having a function called automatically when your database is updated, you might be interested in using <https://sqlite.org/c3ref/update_hook.html> Because of how this works you would want to avoid this function using sqlite3_ calls (explicitly mentioned in the documentation, possibly to avoid recursion). For this reason, if you use this hook your audit file would probably be best as a text file, opened and written using normal file operations rather than SQLite calls. Another way to log changes is to use <https://sqlite.org/c3ref/set_authorizer.html> It should always return SQLITE_OK, but it can note when it is called with commands which would modify your database. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users