Does anyone know a way to register a "persistent" UDF in SQLite 3 (using C or PHP), or something equivalent? I know I can register a UDF as a callback function with the C or PHP API, but that function only lives as long as the application's handle to the database.
In MySQL, I can achieve this with someting like "CREATE FUNCTION my_udf RETURNS INTEGER SONAME 'shared_lib_containing_my_udf.so'.
The reason why I need this is that "Application A" should be notified when "Application B" inserts, updates or deletes data, using triggers that call my UDF. The application that manipulates the DB is a PHP web application. So if I can't make a UDF persistent, I'd have to register the UDF for every web request - and if the application opens more than one connection per web request, I'd even have to register the UDF multiple times per request. This would probably mean having to change the application in many places, which I really want to avoid.
If this isn't possible, does anyone have a different solution?