Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sqlite: add readBigInts as env property
  • Loading branch information
miguelmarcondesf committed Jun 12, 2025
commit 68889b1da77042f817102dcb451b76f7f1f7863c
1 change: 1 addition & 0 deletions src/env_properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@
V(raw_string, "raw") \
V(read_host_object_string, "_readHostObject") \
V(readable_string, "readable") \
V(read_bigints_string, "readBigInts") \
V(reason_string, "reason") \
V(refresh_string, "refresh") \
V(regexp_string, "regexp") \
Expand Down
23 changes: 12 additions & 11 deletions src/node_sqlite.cc
Original file line number Diff line number Diff line change
Expand Up @@ -950,20 +950,20 @@ void DatabaseSync::New(const FunctionCallbackInfo<Value>& args) {
allow_load_extension = allow_extension_v.As<Boolean>()->Value();
}

Local<String> read_bigints_string =
FIXED_ONE_BYTE_STRING(env->isolate(), "readBigInts");
Local<Value> read_bigints_v;
if (options->Get(env->context(), read_bigints_string)
if (options->Get(env->context(), env->read_bigints_string())
.ToLocal(&read_bigints_v)) {
if (!read_bigints_v->IsUndefined()) {
if (!read_bigints_v->IsBoolean()) {
THROW_ERR_INVALID_ARG_TYPE(
env->isolate(),
"The \"options.readBigInts\" argument must be a boolean.");
return;
}
open_config.set_use_big_ints(read_bigints_v.As<Boolean>()->Value());
return;
}

if (!read_bigints_v->IsUndefined()) {
if (!read_bigints_v->IsBoolean()) {
THROW_ERR_INVALID_ARG_TYPE(
env->isolate(),
"The \"options.readBigInts\" argument must be a boolean.");
return;
}
open_config.set_use_big_ints(read_bigints_v.As<Boolean>()->Value());
}

Local<Value> timeout_v;
Expand Down Expand Up @@ -1789,6 +1789,7 @@ StatementSync::StatementSync(Environment* env,
MakeWeak();
statement_ = stmt;
use_big_ints_ = db_->use_big_ints();

// In the future, some of these options could be set at the database
// connection level and inherited by statements to reduce boilerplate.
return_arrays_ = false;
Expand Down