sqlite: add support for unknown named parameters

This commit adds a method for toggling support for unknown named
parameters in prepared statements.

Fixes: https://github.com/nodejs/node/issues/55533
PR-URL: https://github.com/nodejs/node/pull/57552
Reviewed-By: Edy Silva <edigleyssonsilva@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Colin Ihrig authored and RafaelGSS committed 2025-04-17 10:51:51 -03:00
1 parent 2ce79787de
commit bd5c90654a
4 files changed
+84 -3

No files matched your search

+3
View File
@@ -109,6 +109,8 @@ class StatementSync : public BaseObject {
const v8::FunctionCallbackInfo<v8::Value>& args);
static void SetAllowBareNamedParameters(
const v8::FunctionCallbackInfo<v8::Value>& args);
static void SetAllowUnknownNamedParameters(
const v8::FunctionCallbackInfo<v8::Value>& args);
static void SetReadBigInts(const v8::FunctionCallbackInfo<v8::Value>& args);
void Finalize();
bool IsFinalized();
@@ -122,6 +124,7 @@ class StatementSync : public BaseObject {
sqlite3_stmt* statement_;
bool use_big_ints_;
bool allow_bare_named_params_;
bool allow_unknown_named_params_;
std::optional<std::map<std::string, std::string>> bare_named_params_;
bool BindParams(const v8::FunctionCallbackInfo<v8::Value>& args);
bool BindValue(const v8::Local<v8::Value>& value, const int index);