vef: Add Statement Events Capability#645
Conversation
d57e242 to
5e2ed4f
Compare
5e2ed4f to
8f32238
Compare
Read-only query hooks are called at one of five times with relevant metadata: A) Session connect B) Before query is parsed C) After query is parsed D) Before query exection E) After query execution F) Session disconnect Only (E) after query execution is implemented in this change.
8f32238 to
f892d8e
Compare
| bool in_transaction; | ||
|
|
||
| // SQL command as a lowercase string (e.g. "select", "insert", | ||
| // "create_table"). Stable across MySQL version rebases. NULL if unknown. |
| // The pointed-to string has static lifetime and need not be copied. | ||
| const char *sql_command; | ||
|
|
||
| // Default schema (USE <db>), or NULL if none selected. |
There was a problem hiding this comment.
You talk about lifetime above; what's the lifetime if not commented?
There was a problem hiding this comment.
All are now commented. We should probably have an ABI-wide standard.
| extern "C" { | ||
| #endif | ||
|
|
||
| // Preview capability: "vsql::preview::query_hook" |
There was a problem hiding this comment.
OK, my biggest comment is about related functionality and how we want to organize.
AIUI, there are some things called "query hooks" that are on the critical path: I want to rewrite a query has to be on the critical path.
Then some might just be for info. "I want to know this happened".
The latter is perhaps more similar to "OpenTelemetry".
Is it worth thinking at all about hooks that, if they don't work, fail the query, vs. hooks that record info? Which is this?
There was a problem hiding this comment.
Lots of discussion offline. Renamed to statement events.
c596f93 to
71a3c16
Compare
71a3c16 to
0643435
Compare
Read-only query hooks are called at one of five times with relevant metadata:
A) Session connect
B) Before query is parsed
C) After query is parsed
D) Before query exection
E) After query execution
F) Session disconnect
Only (E) after query execution is implemented in this change.