Skip to content

Commit b52ec3e

Browse files
committed
sqlite: rename DatabaseSync to Database
Rename the DatabaseSync class to Database, and the internal DatabaseSyncLimits helper to DatabaseLimits to match. Assisted-by: claude-code:claude-sonnet-5 Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
1 parent c143041 commit b52ec3e

39 files changed

Lines changed: 740 additions & 753 deletions

‎SECURITY.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -430,14 +430,14 @@ the community they pose.
430430

431431
* Examples of scenarios that are **not** Node.js vulnerabilities:
432432
* Allowing untrusted users to register SQLite user-defined functions via
433-
`node:sqlite` (`DatabaseSync`) that can perform arbitrary operations
433+
`node:sqlite` (`Database`) that can perform arbitrary operations
434434
(e.g., closing database connections during query execution, causing crashes
435435
or use-after-free conditions).
436436
* Loading SQLite extensions using the `allowExtension` option in
437-
`DatabaseSync` — this option must be explicitly set to `true` by the
437+
`Database` — this option must be explicitly set to `true` by the
438438
application, and enabling it is the application operator's responsibility.
439439
* Using `node:sqlite` built-in SQL functions or pragmas (e.g.,
440-
`ATTACH DATABASE`) to read or write files — `DatabaseSync` operates with
440+
`ATTACH DATABASE`) to read or write files — `Database` operates with
441441
the same file-system access as the process itself, and it is the
442442
application's responsibility to restrict what SQL is executed.
443443
* Exposing `child_process.exec()` or similar APIs to untrusted users without
@@ -524,7 +524,7 @@ The following are **not** vulnerabilities in Node.js:
524524
responsibility. The permission model does not restrict how Node.js behaves
525525
when the operator intentionally configures it.
526526

527-
* **`node:sqlite` and the permission model**: `DatabaseSync` operates with the
527+
* **`node:sqlite` and the permission model**: `Database` operates with the
528528
same file-system privileges as the process. Using SQL pragmas or built-in
529529
SQLite mechanisms (e.g., `ATTACH DATABASE`) to access files does not bypass
530530
the permission model — the permission model does not intercept SQL-level

‎benchmark/sqlite/sqlite-diagnostic-channel.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, {
1212
function main(conf) {
1313
const { n, mode } = conf;
1414

15-
const db = new sqlite.DatabaseSync(':memory:');
15+
const db = new sqlite.Database(':memory:');
1616
db.exec('CREATE TABLE t (x INTEGER)');
1717
const insert = db.prepare('INSERT INTO t VALUES (?)');
1818

‎benchmark/sqlite/sqlite-is-transaction.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, {
99
});
1010

1111
function main(conf) {
12-
const db = new sqlite.DatabaseSync(':memory:');
12+
const db = new sqlite.Database(':memory:');
1313

1414
if (conf.transaction === 'true') {
1515
db.exec('BEGIN');

‎benchmark/sqlite/sqlite-prepare-insert.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const bench = common.createBenchmark(main, {
1717
});
1818

1919
function main(conf) {
20-
const db = new sqlite.DatabaseSync(':memory:');
20+
const db = new sqlite.Database(':memory:');
2121

2222
db.exec('CREATE TABLE text_column_type (text_column TEXT)');
2323
db.exec('CREATE TABLE integer_column_type (integer_column INTEGER)');

‎benchmark/sqlite/sqlite-prepare-select-all-options.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function main(conf) {
1919
return acc;
2020
}, {});
2121

22-
const db = new sqlite.DatabaseSync(':memory:', optionsObj);
22+
const db = new sqlite.Database(':memory:', optionsObj);
2323

2424
db.exec(
2525
'CREATE TABLE foo (text_column TEXT, integer_column INTEGER, real_column REAL, blob_column BLOB)',

‎benchmark/sqlite/sqlite-prepare-select-all.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const bench = common.createBenchmark(main, {
2424
});
2525

2626
function main(conf) {
27-
const db = new sqlite.DatabaseSync(':memory:');
27+
const db = new sqlite.Database(':memory:');
2828

2929
// Create only the necessary table for the benchmark type.
3030
// If the statement includes 'foo_large', create the foo_large table; otherwise, create the foo table.

‎benchmark/sqlite/sqlite-prepare-select-get-options.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function main(conf) {
1818
return acc;
1919
}, {});
2020

21-
const db = new sqlite.DatabaseSync(':memory:', optionsObj);
21+
const db = new sqlite.Database(':memory:', optionsObj);
2222

2323
db.exec(
2424
'CREATE TABLE foo (text_column TEXT, integer_column INTEGER, real_column REAL, blob_column BLOB)',

‎benchmark/sqlite/sqlite-prepare-select-get.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const bench = common.createBenchmark(main, {
1818
});
1919

2020
function main(conf) {
21-
const db = new sqlite.DatabaseSync(':memory:');
21+
const db = new sqlite.Database(':memory:');
2222

2323
// Create only the necessary table for the benchmark type.
2424
// If the statement includes 'foo_large', create the foo_large table; otherwise, create the foo table.

‎doc/api/diagnostics_channel.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2003,14 +2003,14 @@ added: v26.8.0
20032003
* `sql` {string} The expanded SQL with bound parameter values substituted.
20042004
If expansion fails, the source SQL with unsubstituted placeholders is used
20052005
instead.
2006-
* `database` {DatabaseSync} The [`DatabaseSync`][] instance that executed the
2006+
* `database` {Database} The [`Database`][] instance that executed the
20072007
statement.
20082008
* `duration` {number} SQLite's internal estimate of the statement run time in
20092009
nanoseconds. This reflects C-layer execution time only and does not include
20102010
JavaScript binding overhead such as argument marshaling or result-row
20112011
construction.
20122012

2013-
Emitted after a SQL statement finishes executing against a [`DatabaseSync`][]
2013+
Emitted after a SQL statement finishes executing against a [`Database`][]
20142014
instance. This is a **profiling** event: it fires once per statement upon
20152015
completion and reports an estimated duration from SQLite's internal profiler.
20162016
It is not a distributed-tracing span. There is no corresponding start event,
@@ -2032,7 +2032,7 @@ statement, since both are still in use while the event is being delivered; see
20322032
[`--enable-fips-indicator-events`]: cli.md#--enable-fips-indicator-events
20332033
[`--force-fips=strict`]: cli.md#--force-fips
20342034
[`BoundedChannel`]: #class-boundedchannel
2035-
[`DatabaseSync`]: sqlite.md#class-databasesync
2035+
[`Database`]: sqlite.md#class-database
20362036
[`TracingChannel`]: #class-tracingchannel
20372037
[`asyncEnd` event]: #asyncendevent
20382038
[`asyncStart` event]: #asyncstartevent

0 commit comments

Comments
 (0)