Skip to content

Commit efb9f05

Browse files
cjihrigaduh95
authored andcommitted
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 PR-URL: #55890 Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 9c61038 commit efb9f05

12 files changed

+23
-25
lines changed

doc/api/cli.md

+13-9
Original file line numberDiff line numberDiff line change
@@ -1079,14 +1079,6 @@ added:
10791079

10801080
Use this flag to enable [ShadowRealm][] support.
10811081

1082-
### `--experimental-sqlite`
1083-
1084-
<!-- YAML
1085-
added: v22.5.0
1086-
-->
1087-
1088-
Enable the experimental [`node:sqlite`][] module.
1089-
10901082
### `--experimental-strip-types`
10911083

10921084
<!-- YAML
@@ -1694,6 +1686,18 @@ Disable support for loading a synchronous ES module graph in `require()`.
16941686

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

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

16991703
<!-- YAML
@@ -3045,7 +3049,6 @@ one is included in the list below.
30453049
* `--experimental-require-module`
30463050
* `--experimental-shadow-realm`
30473051
* `--experimental-specifier-resolution`
3048-
* `--experimental-sqlite`
30493052
* `--experimental-strip-types`
30503053
* `--experimental-top-level-await`
30513054
* `--experimental-transform-types`
@@ -3081,6 +3084,7 @@ one is included in the list below.
30813084
* `--no-deprecation`
30823085
* `--no-experimental-global-navigator`
30833086
* `--no-experimental-repl-await`
3087+
* `--no-experimental-sqlite`
30843088
* `--no-experimental-websocket`
30853089
* `--no-extra-info-on-fatal-exception`
30863090
* `--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)