Skip to content

Commit a54b0ac

Browse files
committedNov 18, 2024
doc,lib,src,test: unflag sqlite module
This commit allows the node:sqlite module to be used without starting Node with a CLI flag. The module is still experimental. Fixes: #55854
1 parent 746b17e commit a54b0ac

12 files changed

+23
-25
lines changed
 

‎doc/api/cli.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -1065,14 +1065,6 @@ added:
10651065

10661066
Use this flag to enable [ShadowRealm][] support.
10671067

1068-
### `--experimental-sqlite`
1069-
1070-
<!-- YAML
1071-
added: v22.5.0
1072-
-->
1073-
1074-
Enable the experimental [`node:sqlite`][] module.
1075-
10761068
### `--experimental-strip-types`
10771069

10781070
<!-- YAML
@@ -1693,6 +1685,18 @@ Disable support for loading a synchronous ES module graph in `require()`.
16931685

16941686
See [Loading ECMAScript modules using `require()`][].
16951687

1688+
### `--no-experimental-sqlite`
1689+
1690+
<!-- YAML
1691+
added: v22.5.0
1692+
changes:
1693+
- version: REPLACEME
1694+
pr-url: https://github.com/nodejs/node/pull/55890
1695+
description: SQLite is unflagged but still experimental.
1696+
-->
1697+
1698+
Disable the experimental [`node:sqlite`][] module.
1699+
16961700
### `--no-experimental-websocket`
16971701

16981702
<!-- YAML
@@ -3043,7 +3047,6 @@ one is included in the list below.
30433047
* `--experimental-require-module`
30443048
* `--experimental-shadow-realm`
30453049
* `--experimental-specifier-resolution`
3046-
* `--experimental-sqlite`
30473050
* `--experimental-strip-types`
30483051
* `--experimental-top-level-await`
30493052
* `--experimental-transform-types`
@@ -3080,6 +3083,7 @@ one is included in the list below.
30803083
* `--no-deprecation`
30813084
* `--no-experimental-global-navigator`
30823085
* `--no-experimental-repl-await`
3086+
* `--no-experimental-sqlite`
30833087
* `--no-experimental-websocket`
30843088
* `--no-extra-info-on-fatal-exception`
30853089
* `--no-force-async-hooks-checks`

‎doc/api/sqlite.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
added: v22.5.0
77
-->
88

9-
> Stability: 1.1 - Active development. Enable this API with the
10-
> [`--experimental-sqlite`][] CLI flag.
9+
> Stability: 1.1 - Active development.
1110
1211
<!-- source_link=lib/sqlite.js -->
1312

@@ -412,7 +411,6 @@ The following constants are meant for use with [`database.applyChangeset()`](#da
412411

413412
[Changesets and Patchsets]: https://www.sqlite.org/sessionintro.html#changesets_and_patchsets
414413
[SQL injection]: https://en.wikipedia.org/wiki/SQL_injection
415-
[`--experimental-sqlite`]: cli.md#--experimental-sqlite
416414
[`ATTACH DATABASE`]: https://www.sqlite.org/lang_attach.html
417415
[`PRAGMA foreign_keys`]: https://www.sqlite.org/pragma.html#pragma_foreign_keys
418416
[`sqlite3_changes64()`]: https://www.sqlite.org/c3ref/changes.html

‎doc/node.1

+3-3
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,6 @@ Enable the experimental permission model.
182182
.It Fl -experimental-shadow-realm
183183
Use this flag to enable ShadowRealm support.
184184
.
185-
.It Fl -experimental-sqlite
186-
Enable the experimental node:sqlite module.
187-
.
188185
.It Fl -experimental-test-coverage
189186
Enable code coverage in the test runner.
190187
.
@@ -215,6 +212,9 @@ Enable experimental support for the Web Storage API.
215212
.It Fl -no-experimental-repl-await
216213
Disable top-level await keyword support in REPL.
217214
.
215+
.It Fl -no-experimental-sqlite
216+
Disable the experimental node:sqlite module.
217+
.
218218
.It Fl -experimental-vm-modules
219219
Enable experimental ES module support in VM module.
220220
.

‎lib/internal/process/pre_execution.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ function setupNavigator() {
303303
}
304304

305305
function setupSQLite() {
306-
if (!getOptionValue('--experimental-sqlite')) {
306+
if (getOptionValue('--no-experimental-sqlite')) {
307307
return;
308308
}
309309

‎src/node_options.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
427427
AddOption("--experimental-sqlite",
428428
"experimental node:sqlite module",
429429
&EnvironmentOptions::experimental_sqlite,
430-
kAllowedInEnvvar);
430+
kAllowedInEnvvar,
431+
true);
431432
AddOption("--experimental-webstorage",
432433
"experimental Web Storage API",
433434
&EnvironmentOptions::experimental_webstorage,

‎src/node_options.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class EnvironmentOptions : public Options {
123123
bool experimental_eventsource = false;
124124
bool experimental_fetch = true;
125125
bool experimental_websocket = true;
126-
bool experimental_sqlite = false;
126+
bool experimental_sqlite = true;
127127
bool experimental_webstorage = false;
128128
std::string localstorage_file;
129129
bool experimental_global_navigator = true;

‎test/parallel/test-sqlite-data-types.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-sqlite
21
'use strict';
32
require('../common');
43
const tmpdir = require('../common/tmpdir');

‎test/parallel/test-sqlite-database-sync.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-sqlite
21
'use strict';
32
require('../common');
43
const tmpdir = require('../common/tmpdir');

‎test/parallel/test-sqlite-named-parameters.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-sqlite
21
'use strict';
32
require('../common');
43
const tmpdir = require('../common/tmpdir');

‎test/parallel/test-sqlite-statement-sync.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-sqlite
21
'use strict';
32
require('../common');
43
const tmpdir = require('../common/tmpdir');

‎test/parallel/test-sqlite-transactions.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-sqlite
21
'use strict';
32
require('../common');
43
const tmpdir = require('../common/tmpdir');

‎test/parallel/test-sqlite.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Flags: --experimental-sqlite
21
'use strict';
32
const { spawnPromisified } = require('../common');
43
const tmpdir = require('../common/tmpdir');
@@ -23,13 +22,14 @@ suite('accessing the node:sqlite module', () => {
2322
});
2423
});
2524

26-
test('cannot be accessed without --experimental-sqlite flag', async (t) => {
25+
test('can be disabled with --no-experimental-sqlite flag', async (t) => {
2726
const {
2827
stdout,
2928
stderr,
3029
code,
3130
signal,
3231
} = await spawnPromisified(process.execPath, [
32+
'--no-experimental-sqlite',
3333
'-e',
3434
'require("node:sqlite")',
3535
]);

0 commit comments

Comments
 (0)