Re: [sqlite] Function design question

2018-03-15 Thread petern
Simply bracket your server code with preprocessor directives like so: static void my_universal_function(sqlite3_context *context, int argc, sqlite3_value **argv) { #ifdef MY_SQLITE_EXTENSION_MODE #else #endif } Then create another makefile rule target or IDE project which defines the

Re: [sqlite] Function design question

2018-03-15 Thread Simon Slavin
On 15 Mar 2018, at 11:40am, Toby Dickenson 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

[sqlite] Function design question

2018-03-15 Thread Toby Dickenson
I am using a trigger to maintain some audit information, for example updating row modification time on any insert or update. I now want to extend that mechanism to include other information from my application, for example logged in user name. I can do that by registering new functions to pass the