Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,14 @@ the community they pose.

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

* **`node:sqlite` and the permission model**: `DatabaseSync` operates with the
* **`node:sqlite` and the permission model**: `Database` operates with the
same file-system privileges as the process. Using SQL pragmas or built-in
SQLite mechanisms (e.g., `ATTACH DATABASE`) to access files does not bypass
the permission model — the permission model does not intercept SQL-level
Expand Down
2 changes: 1 addition & 1 deletion benchmark/sqlite/sqlite-diagnostic-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const bench = common.createBenchmark(main, {
function main(conf) {
const { n, mode } = conf;

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

Expand Down
2 changes: 1 addition & 1 deletion benchmark/sqlite/sqlite-is-transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const bench = common.createBenchmark(main, {
});

function main(conf) {
const db = new sqlite.DatabaseSync(':memory:');
const db = new sqlite.Database(':memory:');

if (conf.transaction === 'true') {
db.exec('BEGIN');
Expand Down
2 changes: 1 addition & 1 deletion benchmark/sqlite/sqlite-prepare-insert.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const bench = common.createBenchmark(main, {
});

function main(conf) {
const db = new sqlite.DatabaseSync(':memory:');
const db = new sqlite.Database(':memory:');

db.exec('CREATE TABLE text_column_type (text_column TEXT)');
db.exec('CREATE TABLE integer_column_type (integer_column INTEGER)');
Expand Down
2 changes: 1 addition & 1 deletion benchmark/sqlite/sqlite-prepare-select-all-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function main(conf) {
return acc;
}, {});

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

db.exec(
'CREATE TABLE foo (text_column TEXT, integer_column INTEGER, real_column REAL, blob_column BLOB)',
Expand Down
2 changes: 1 addition & 1 deletion benchmark/sqlite/sqlite-prepare-select-all.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const bench = common.createBenchmark(main, {
});

function main(conf) {
const db = new sqlite.DatabaseSync(':memory:');
const db = new sqlite.Database(':memory:');

// Create only the necessary table for the benchmark type.
// If the statement includes 'foo_large', create the foo_large table; otherwise, create the foo table.
Expand Down
2 changes: 1 addition & 1 deletion benchmark/sqlite/sqlite-prepare-select-get-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function main(conf) {
return acc;
}, {});

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

db.exec(
'CREATE TABLE foo (text_column TEXT, integer_column INTEGER, real_column REAL, blob_column BLOB)',
Expand Down
2 changes: 1 addition & 1 deletion benchmark/sqlite/sqlite-prepare-select-get.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const bench = common.createBenchmark(main, {
});

function main(conf) {
const db = new sqlite.DatabaseSync(':memory:');
const db = new sqlite.Database(':memory:');

// Create only the necessary table for the benchmark type.
// If the statement includes 'foo_large', create the foo_large table; otherwise, create the foo table.
Expand Down
14 changes: 14 additions & 0 deletions doc/api/deprecations.md
Original file line number Diff line number Diff line change
Expand Up @@ -4801,6 +4801,20 @@ async function example() {
}
```

### DEP0210: `sqlite.DatabaseSync`

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/65988
description: Runtime deprecation.
-->

Type: Runtime

`node:sqlite`'s `DatabaseSync` class was renamed to `Database`. `DatabaseSync`
is kept as a deprecated alias. Use `Database` instead.

[DEP0142]: #dep0142-repl_builtinlibs
[DEP0156]: #dep0156-aborted-property-and-abort-aborted-event-in-http
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
Expand Down
6 changes: 3 additions & 3 deletions doc/api/diagnostics_channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -2003,14 +2003,14 @@ added: v26.8.0
* `sql` {string} The expanded SQL with bound parameter values substituted.
If expansion fails, the source SQL with unsubstituted placeholders is used
instead.
* `database` {DatabaseSync} The [`DatabaseSync`][] instance that executed the
* `database` {Database} The [`Database`][] instance that executed the
statement.
* `duration` {number} SQLite's internal estimate of the statement run time in
nanoseconds. This reflects C-layer execution time only and does not include
JavaScript binding overhead such as argument marshaling or result-row
construction.

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