Closed rogerbinns closed 1 month ago
Implemented for sqlite3_trace_v2
calls where I already had to handle thesqlite3_profile
deprecation co-existence.
It doesn't make sense for auth - what if one callback says yes and one says no and one says ignore?
The progress callback might be useful, but I'll wait till someone asks.
Currently there can only be one profiler, one authorizer, one collation needed callback etc.
This is especially problematic with the profiler because apswtrace needs it, but if any other code installs a tracer then apswtrace sees nothing.
The simplest approach would be to add a
name
parameter when they are registered/unregistered. The default isNone
. Internally APSW would keep a list for the callback and invoke the appropriate ones.As an example the
sqlite3_tracev2
would be a array of:Then when a trace event fires the list is traversed and any whose
mask
matches the event is called.Some additional things:
name
andcallback
beNULL
on deletion an never resize the list to be smaller.name
matches on register/unregister