I would like to add a user-defined function using Sqlite3's create_function, which will be used by database triggers.
Is there a way to hook into ActiveRecord connection establishment to run some code each time a connection to the database is made, where one could create the function and make it available to the triggers? This would also be useful for setting pragmas on the connection.