Commit 1611823f462 for nodejs
commit 1611823f4628f8b449755eda43bbeacdf8dff204
Author: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
Date: Mon Nov 30 06:44:40 2026 -0300
cli: remove --no-experimental-sqlite flag
node:sqlite is stable, so it no longer needs an opt-out.
--experimental-sqlite stays as an undocumented no-op, like
--experimental-websocket. Builds without SQLite now expose the
module, which throws ERR_NO_SQLITE when loaded.
Signed-off-by: Christian Aurich Zanettini Martins <christian.aurichzm@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/67698
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
diff --git a/doc/api/cli.md b/doc/api/cli.md
index 26aa4ce9951..98d66eeccbd 100644
--- a/doc/api/cli.md
+++ b/doc/api/cli.md
@@ -2384,20 +2384,6 @@ changes:
Legacy alias for [`--no-require-module`][].
-### `--no-experimental-sqlite`
-
-<!-- YAML
-added: v22.5.0
-changes:
- - version:
- - v23.4.0
- - v22.13.0
- pr-url: https://github.com/nodejs/node/pull/55890
- description: SQLite is unflagged but still experimental.
--->
-
-Disable the [`node:sqlite`][] module.
-
### `--no-experimental-vfs`
<!-- YAML
@@ -4403,6 +4389,7 @@ one is included in the list below.
* `--experimental-repl-await`
* `--experimental-require-module`
* `--experimental-specifier-resolution`
+* `--experimental-sqlite`
* `--experimental-stream-iter`
* `--experimental-strip-private-modules`
* `--experimental-test-isolation`
@@ -4440,7 +4427,6 @@ one is included in the list below.
* `--no-experimental-ffi`
* `--no-experimental-global-navigator`
* `--no-experimental-import-text`
-* `--no-experimental-sqlite`
* `--no-experimental-strip-types`
* `--no-experimental-vfs`
* `--no-experimental-web-worker`
@@ -5088,7 +5074,6 @@ node --stack-trace-limit=12 -p -e "Error.stackTraceLimit" # prints 12
[`module.setSourceMapsSupport()`]: module.md#modulesetsourcemapssupportenabled-options
[`net.getDefaultAutoSelectFamilyAttemptTimeout()`]: net.md#netgetdefaultautoselectfamilyattempttimeout
[`node:ffi`]: ffi.md
-[`node:sqlite`]: sqlite.md
[`node:stream/iter`]: stream_iter.md
[`node:vfs`]: vfs.md
[`permission.drop()`]: permissions.md#permissiondropscope-reference
diff --git a/doc/api/sqlite.md b/doc/api/sqlite.md
index 1d02ca67606..1ed1dd74bf5 100644
--- a/doc/api/sqlite.md
+++ b/doc/api/sqlite.md
@@ -5,6 +5,9 @@
<!-- YAML
added: v22.5.0
changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/67698
+ description: No longer disableable with the `--no-experimental-sqlite` CLI flag.
- version: v27.0.0-alpha.0.2.0
pr-url: https://github.com/nodejs/node/pull/67654
description: SQLite is now stable.
@@ -39,6 +42,9 @@ This module is only available under the `node:` scheme. SQL trace events can
be observed via the [`diagnostics_channel`][] module. See
[`'sqlite.db.query'`][] for details.
+When Node.js is built without SQLite support, loading this module throws
+[`ERR_NO_SQLITE`][].
+
The following example shows the basic usage of the `node:sqlite` module to open
an in-memory database, write data to the database, and then read the data back.
@@ -2172,6 +2178,7 @@ callback function to indicate what type of operation is being authorized.
[`'sqlite.db.query'`]: diagnostics_channel.md#event-sqlitedbquery
[`ATTACH DATABASE`]: https://www.sqlite.org/lang_attach.html
[`ERR_INVALID_STATE`]: errors.md#err_invalid_state
+[`ERR_NO_SQLITE`]: errors.md#err_no_sqlite
[`PRAGMA foreign_keys`]: https://www.sqlite.org/pragma.html#pragma_foreign_keys
[`SQLITE_DBCONFIG_DEFENSIVE`]: https://www.sqlite.org/c3ref/c_dbconfig_defensive.html#sqlitedbconfigdefensive
[`SQLITE_DETERMINISTIC`]: https://www.sqlite.org/c3ref/c_deterministic.html
diff --git a/doc/node-config-schema.json b/doc/node-config-schema.json
index 65d50c4d328..098bae8efd3 100644
--- a/doc/node-config-schema.json
+++ b/doc/node-config-schema.json
@@ -379,10 +379,6 @@
"type": "boolean",
"description": "Legacy alias for --require-module"
},
- "experimental-sqlite": {
- "type": "boolean",
- "description": "experimental node:sqlite module"
- },
"experimental-stream-iter": {
"type": "boolean",
"description": "experimental iterable streams API (node:stream/iter)"
diff --git a/doc/node.1 b/doc/node.1
index c491f183ad2..c7b49c61603 100644
--- a/doc/node.1
+++ b/doc/node.1
@@ -1275,9 +1275,6 @@ Disable importing modules with \fBwith { type: 'text' }\fR.
.It Fl -no-experimental-require-module
Legacy alias for \fB--no-require-module\fR.
.
-.It Fl -no-experimental-sqlite
-Disable the \fBnode:sqlite\fR module.
-.
.It Fl -no-experimental-vfs
Disable the experimental \fBnode:vfs\fR module and \fB--vfs-load\fR.
.
@@ -2357,6 +2354,8 @@ one is included in the list below.
.It
\fB--experimental-specifier-resolution\fR
.It
+\fB--experimental-sqlite\fR
+.It
\fB--experimental-stream-iter\fR
.It
\fB--experimental-strip-private-modules\fR
@@ -2431,8 +2430,6 @@ one is included in the list below.
.It
\fB--no-experimental-import-text\fR
.It
-\fB--no-experimental-sqlite\fR
-.It
\fB--no-experimental-strip-types\fR
.It
\fB--no-experimental-vfs\fR
diff --git a/lib/internal/bootstrap/realm.js b/lib/internal/bootstrap/realm.js
index 16fbc965bab..70e25d4b360 100644
--- a/lib/internal/bootstrap/realm.js
+++ b/lib/internal/bootstrap/realm.js
@@ -202,7 +202,7 @@ const builtinModulePolicies = [
['dtls', true, '--experimental-dtls'],
['ffi', true, '--experimental-ffi'],
['sea', true, null],
- ['sqlite', true, '--experimental-sqlite'],
+ ['sqlite', true, null],
['quic', true, '--experimental-quic'],
['stream/iter', false, '--experimental-stream-iter'],
['test', true, null],
diff --git a/src/node_options.cc b/src/node_options.cc
index b5579198eaf..cece3acc4a9 100644
--- a/src/node_options.cc
+++ b/src/node_options.cc
@@ -800,11 +800,7 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
true);
AddOption("--experimental-websocket", "", NoOp{}, kAllowedInEnvvar);
AddOption("--experimental-global-customevent", "", NoOp{}, kAllowedInEnvvar);
- AddOption("--experimental-sqlite",
- "experimental node:sqlite module",
- BOOL_FIELD(experimental_sqlite),
- kAllowedInEnvvar,
- HAVE_SQLITE);
+ AddOption("--experimental-sqlite", "", NoOp{}, kAllowedInEnvvar);
AddOption("--experimental-stream-iter",
"experimental iterable streams API (node:stream/iter)",
BOOL_FIELD(experimental_stream_iter),
diff --git a/src/node_options.h b/src/node_options.h
index 260d6e43e83..6392c39cd3d 100644
--- a/src/node_options.h
+++ b/src/node_options.h
@@ -217,7 +217,6 @@ class EnvironmentOptions : public Options {
DEFINE_BOOL_FIELD(experimental_ffi) = HAVE_FFI;
DEFINE_BOOL_FIELD(experimental_web_worker) = true;
DEFINE_BOOL_FIELD(experimental_websocket) = true;
- DEFINE_BOOL_FIELD(experimental_sqlite) = HAVE_SQLITE;
DEFINE_BOOL_FIELD(experimental_stream_iter) = EXPERIMENTALS_DEFAULT_VALUE;
DEFINE_BOOL_FIELD(experimental_vfs) = true;
DEFINE_BOOL_FIELD(vfs_load) = false;
diff --git a/test/parallel/test-sqlite-session.js b/test/parallel/test-sqlite-session.js
index ee0c2cfb3af..06d4bedd68b 100644
--- a/test/parallel/test-sqlite-session.js
+++ b/test/parallel/test-sqlite-session.js
@@ -1,4 +1,4 @@
-// Flags: --expose-gc --experimental-sqlite
+// Flags: --expose-gc
'use strict';
const { skipIfSQLiteMissing } = require('../common');
skipIfSQLiteMissing();
diff --git a/test/parallel/test-sqlite-without-sqlite.js b/test/parallel/test-sqlite-without-sqlite.js
index ee1a44e44f8..7e208abcdcc 100644
--- a/test/parallel/test-sqlite-without-sqlite.js
+++ b/test/parallel/test-sqlite-without-sqlite.js
@@ -1,4 +1,3 @@
-// Flags: --experimental-sqlite
'use strict';
const { hasSQLite } = require('../common');
diff --git a/test/parallel/test-sqlite.js b/test/parallel/test-sqlite.js
index a49a6006242..f9fcc1f500b 100644
--- a/test/parallel/test-sqlite.js
+++ b/test/parallel/test-sqlite.js
@@ -16,22 +16,31 @@ suite('accessing the node:sqlite module', () => {
});
});
- test('can be disabled with --no-experimental-sqlite flag', async (t) => {
- const {
- stdout,
- stderr,
- code,
- signal,
- } = await spawnPromisified(process.execPath, [
+ test('can be accessed with the no-op --experimental-sqlite flag', async (t) => {
+ const result = await spawnPromisified(process.execPath, [
+ '--experimental-sqlite',
+ '-p',
+ 'typeof require("node:sqlite").Database',
+ ]);
+
+ t.assert.deepStrictEqual(result, {
+ code: 0,
+ signal: null,
+ stderr: '',
+ stdout: 'function\n',
+ });
+ });
+
+ test('cannot be disabled with --no-experimental-sqlite', async (t) => {
+ const { code, signal, stderr } = await spawnPromisified(process.execPath, [
'--no-experimental-sqlite',
'-e',
- 'require("node:sqlite")',
+ '',
]);
- t.assert.strictEqual(stdout, '');
- t.assert.match(stderr, /No such built-in module: node:sqlite/);
- t.assert.notStrictEqual(code, 0);
+ t.assert.strictEqual(code, 9);
t.assert.strictEqual(signal, null);
+ t.assert.match(stderr, /--no-experimental-sqlite is an invalid negation/);
});
});