You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, I'm not seeing the logs. When looking at the code that registers the handle, I don't see it actually passing my callback through. Though I'm not so familiar with that C API so maybe I'm misunderstanding the code. Regardless I'm not getting these logs even when expected.
Steps to Reproduce
Register the trace/profile events as shown above
Make SQL query
Expected: See log of query/profile
Result: No logs outputted
Version
5.1.6
Node.js Version
v20.8.1
How did you install the library?
yarn add on mac OSX
The text was updated successfully, but these errors were encountered:
The new v2 version: "Each call to either sqlite3_trace(D,X,P) or sqlite3_trace_v2(D,M,X,P) overrides (cancels) all prior calls to sqlite3_trace(D,X,P) or sqlite3_trace_v2(D,M,X,P) for the database connection D. Each database connection may have at most one trace callback."
-- https://www.sqlite.org/c3ref/trace_v2.html
The v2 conceptual model differs slightly in that now a single callback is registered with a trace bitmask comprised of:
Presumably the underlying library is now pushing the currently used deprecated (apparently since 2016) versions through the v2 path, which means only the last one applies. This matches what people are seeing: only the last registered trace or profile currently triggers now, and all previously registered ones are discarded.
For reference, cpython made the change to v2 for themselves in 2020 here: python/cpython#84498
It's probably a good idea and time for this library to adapt to the v2 approach! I suspect this reported bug and many other confusions and frustrations exist as a result of continuing to use the deprecated trace/profile approach.
(Originally posted a version of this in the old closed thread #1474)
Issue Summary
I'm attempting to get my SQLite 3 node to log the queries it runs when in verbose mode. I registered the handles in the following way:
However, I'm not seeing the logs. When looking at the code that registers the handle, I don't see it actually passing my callback through. Though I'm not so familiar with that C API so maybe I'm misunderstanding the code. Regardless I'm not getting these logs even when expected.
Steps to Reproduce
Expected: See log of query/profile
Result: No logs outputted
Version
5.1.6
Node.js Version
v20.8.1
How did you install the library?
yarn add
on mac OSXThe text was updated successfully, but these errors were encountered: