Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 36.7k
sqlite: expose prepared statement statistics#64541
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e75cedb6f2a5fc33c7091849d7735ff1f165a865877d21604File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -52,6 +52,32 @@ static_assert( | ||
| CheckLimitIndices(), | ||
| "Each kLimitMapping entry's sqlite_limit_id must match its index"); | ||
| // Mapping from JavaScript counter names to SQLite statement status constants | ||
| struct StatusInfo { | ||
| std::string_view js_name; | ||
| int sqlite_status_id; | ||
| }; | ||
| // SQLITE_STMTSTATUS_FILTER_HIT and SQLITE_STMTSTATUS_FILTER_MISS require | ||
| // SQLite >= 3.38.0. Older shared-library builds omit the two counters. | ||
| #if SQLITE_VERSION_NUMBER >= 3038000 | ||
| #define NODE_SQLITE_HAS_FILTER_STATUS 1 | ||
| #endif | ||
| inline constexpr auto kStatusMapping = std::to_array<StatusInfo>({ | ||
| {"fullscanStep", SQLITE_STMTSTATUS_FULLSCAN_STEP}, | ||
| {"sort", SQLITE_STMTSTATUS_SORT}, | ||
| {"autoindex", SQLITE_STMTSTATUS_AUTOINDEX}, | ||
| {"vmStep", SQLITE_STMTSTATUS_VM_STEP}, | ||
| {"reprepare", SQLITE_STMTSTATUS_REPREPARE}, | ||
| {"run", SQLITE_STMTSTATUS_RUN}, | ||
| #ifdef NODE_SQLITE_HAS_FILTER_STATUS | ||
| {"filterMiss", SQLITE_STMTSTATUS_FILTER_MISS}, | ||
| {"filterHit", SQLITE_STMTSTATUS_FILTER_HIT}, | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
3.37.2: https://github.com/sqlite/sqlite/blob/version-3.37.2/src/sqlite.h.in Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So maybe we need to enforce a minimum SQLite version on ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do u suggest? A CHECK or something?
| ||
| #endif | ||
| {"memused", SQLITE_STMTSTATUS_MEMUSED}, | ||
geeksilva97 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| }); | ||
| class DatabaseOpenConfiguration { | ||
| public: | ||
| explicit DatabaseOpenConfiguration(std::string&& location) | ||
| @@ -284,6 +310,8 @@ class StatementSync : public BaseObject { | ||
| static void SourceSQLGetter(const v8::FunctionCallbackInfo<v8::Value>& args); | ||
| static void ExpandedSQLGetter( | ||
| const v8::FunctionCallbackInfo<v8::Value>& args); | ||
| static void Stat(const v8::FunctionCallbackInfo<v8::Value>& args); | ||
| static void ResetStats(const v8::FunctionCallbackInfo<v8::Value>& args); | ||
| static void SetAllowBareNamedParameters( | ||
| const v8::FunctionCallbackInfo<v8::Value>& args); | ||
| static void SetAllowUnknownNamedParameters( | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.