mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
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: https://github.com/nodejs/node/issues/55854 PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
1 parent
d1830685b4
commit
1d01ad6773
12 files changed
+23
-25
No files matched your search
+13
-9
@@ -1065,14 +1065,6 @@ added:
|
|||||||
|
|
||||||
Use this flag to enable [ShadowRealm][] support.
|
Use this flag to enable [ShadowRealm][] support.
|
||||||
|
|
||||||
### `--experimental-sqlite`
|
|
||||||
|
|
||||||
<!-- YAML
|
|
||||||
added: v22.5.0
|
|
||||||
-->
|
|
||||||
|
|
||||||
Enable the experimental [`node:sqlite`][] module.
|
|
||||||
|
|
||||||
### `--experimental-strip-types`
|
### `--experimental-strip-types`
|
||||||
|
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
@@ -1693,6 +1685,18 @@ Disable support for loading a synchronous ES module graph in `require()`.
|
|||||||
|
|
||||||
See [Loading ECMAScript modules using `require()`][].
|
See [Loading ECMAScript modules using `require()`][].
|
||||||
|
|
||||||
|
### `--no-experimental-sqlite`
|
||||||
|
|
||||||
|
<!-- YAML
|
||||||
|
added: v22.5.0
|
||||||
|
changes:
|
||||||
|
- version: REPLACEME
|
||||||
|
pr-url: https://github.com/nodejs/node/pull/55890
|
||||||
|
description: SQLite is unflagged but still experimental.
|
||||||
|
-->
|
||||||
|
|
||||||
|
Disable the experimental [`node:sqlite`][] module.
|
||||||
|
|
||||||
### `--no-experimental-websocket`
|
### `--no-experimental-websocket`
|
||||||
|
|
||||||
<!-- YAML
|
<!-- YAML
|
||||||
@@ -3043,7 +3047,6 @@ one is included in the list below.
|
|||||||
* `--experimental-require-module`
|
* `--experimental-require-module`
|
||||||
* `--experimental-shadow-realm`
|
* `--experimental-shadow-realm`
|
||||||
* `--experimental-specifier-resolution`
|
* `--experimental-specifier-resolution`
|
||||||
* `--experimental-sqlite`
|
|
||||||
* `--experimental-strip-types`
|
* `--experimental-strip-types`
|
||||||
* `--experimental-top-level-await`
|
* `--experimental-top-level-await`
|
||||||
* `--experimental-transform-types`
|
* `--experimental-transform-types`
|
||||||
@@ -3080,6 +3083,7 @@ one is included in the list below.
|
|||||||
* `--no-deprecation`
|
* `--no-deprecation`
|
||||||
* `--no-experimental-global-navigator`
|
* `--no-experimental-global-navigator`
|
||||||
* `--no-experimental-repl-await`
|
* `--no-experimental-repl-await`
|
||||||
|
* `--no-experimental-sqlite`
|
||||||
* `--no-experimental-websocket`
|
* `--no-experimental-websocket`
|
||||||
* `--no-extra-info-on-fatal-exception`
|
* `--no-extra-info-on-fatal-exception`
|
||||||
* `--no-force-async-hooks-checks`
|
* `--no-force-async-hooks-checks`
|
||||||
|
|||||||
+1
-3
@@ -6,8 +6,7 @@
|
|||||||
added: v22.5.0
|
added: v22.5.0
|
||||||
-->
|
-->
|
||||||
|
|
||||||
> Stability: 1.1 - Active development. Enable this API with the
|
> Stability: 1.1 - Active development.
|
||||||
> [`--experimental-sqlite`][] CLI flag.
|
|
||||||
|
|
||||||
<!-- source_link=lib/sqlite.js -->
|
<!-- source_link=lib/sqlite.js -->
|
||||||
|
|
||||||
@@ -412,7 +411,6 @@ The following constants are meant for use with [`database.applyChangeset()`](#da
|
|||||||
|
|
||||||
[Changesets and Patchsets]: https://www.sqlite.org/sessionintro.html#changesets_and_patchsets
|
[Changesets and Patchsets]: https://www.sqlite.org/sessionintro.html#changesets_and_patchsets
|
||||||
[SQL injection]: https://en.wikipedia.org/wiki/SQL_injection
|
[SQL injection]: https://en.wikipedia.org/wiki/SQL_injection
|
||||||
[`--experimental-sqlite`]: cli.md#--experimental-sqlite
|
|
||||||
[`ATTACH DATABASE`]: https://www.sqlite.org/lang_attach.html
|
[`ATTACH DATABASE`]: https://www.sqlite.org/lang_attach.html
|
||||||
[`PRAGMA foreign_keys`]: https://www.sqlite.org/pragma.html#pragma_foreign_keys
|
[`PRAGMA foreign_keys`]: https://www.sqlite.org/pragma.html#pragma_foreign_keys
|
||||||
[`sqlite3_changes64()`]: https://www.sqlite.org/c3ref/changes.html
|
[`sqlite3_changes64()`]: https://www.sqlite.org/c3ref/changes.html
|
||||||
|
|||||||
+3
-3
@@ -182,9 +182,6 @@ Enable the experimental permission model.
|
|||||||
.It Fl -experimental-shadow-realm
|
.It Fl -experimental-shadow-realm
|
||||||
Use this flag to enable ShadowRealm support.
|
Use this flag to enable ShadowRealm support.
|
||||||
.
|
.
|
||||||
.It Fl -experimental-sqlite
|
|
||||||
Enable the experimental node:sqlite module.
|
|
||||||
.
|
|
||||||
.It Fl -experimental-test-coverage
|
.It Fl -experimental-test-coverage
|
||||||
Enable code coverage in the test runner.
|
Enable code coverage in the test runner.
|
||||||
.
|
.
|
||||||
@@ -215,6 +212,9 @@ Enable experimental support for the Web Storage API.
|
|||||||
.It Fl -no-experimental-repl-await
|
.It Fl -no-experimental-repl-await
|
||||||
Disable top-level await keyword support in REPL.
|
Disable top-level await keyword support in REPL.
|
||||||
.
|
.
|
||||||
|
.It Fl -no-experimental-sqlite
|
||||||
|
Disable the experimental node:sqlite module.
|
||||||
|
.
|
||||||
.It Fl -experimental-vm-modules
|
.It Fl -experimental-vm-modules
|
||||||
Enable experimental ES module support in VM module.
|
Enable experimental ES module support in VM module.
|
||||||
.
|
.
|
||||||
|
|||||||
@@ -303,7 +303,7 @@ function setupNavigator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setupSQLite() {
|
function setupSQLite() {
|
||||||
if (!getOptionValue('--experimental-sqlite')) {
|
if (getOptionValue('--no-experimental-sqlite')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -427,7 +427,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
|
|||||||
AddOption("--experimental-sqlite",
|
AddOption("--experimental-sqlite",
|
||||||
"experimental node:sqlite module",
|
"experimental node:sqlite module",
|
||||||
&EnvironmentOptions::experimental_sqlite,
|
&EnvironmentOptions::experimental_sqlite,
|
||||||
kAllowedInEnvvar);
|
kAllowedInEnvvar,
|
||||||
|
true);
|
||||||
AddOption("--experimental-webstorage",
|
AddOption("--experimental-webstorage",
|
||||||
"experimental Web Storage API",
|
"experimental Web Storage API",
|
||||||
&EnvironmentOptions::experimental_webstorage,
|
&EnvironmentOptions::experimental_webstorage,
|
||||||
|
|||||||
+1
-1
@@ -123,7 +123,7 @@ class EnvironmentOptions : public Options {
|
|||||||
bool experimental_eventsource = false;
|
bool experimental_eventsource = false;
|
||||||
bool experimental_fetch = true;
|
bool experimental_fetch = true;
|
||||||
bool experimental_websocket = true;
|
bool experimental_websocket = true;
|
||||||
bool experimental_sqlite = false;
|
bool experimental_sqlite = true;
|
||||||
bool experimental_webstorage = false;
|
bool experimental_webstorage = false;
|
||||||
std::string localstorage_file;
|
std::string localstorage_file;
|
||||||
bool experimental_global_navigator = true;
|
bool experimental_global_navigator = true;
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// Flags: --experimental-sqlite
|
|
||||||
'use strict';
|
'use strict';
|
||||||
require('../common');
|
require('../common');
|
||||||
const tmpdir = require('../common/tmpdir');
|
const tmpdir = require('../common/tmpdir');
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// Flags: --experimental-sqlite
|
|
||||||
'use strict';
|
'use strict';
|
||||||
require('../common');
|
require('../common');
|
||||||
const tmpdir = require('../common/tmpdir');
|
const tmpdir = require('../common/tmpdir');
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// Flags: --experimental-sqlite
|
|
||||||
'use strict';
|
'use strict';
|
||||||
require('../common');
|
require('../common');
|
||||||
const tmpdir = require('../common/tmpdir');
|
const tmpdir = require('../common/tmpdir');
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// Flags: --experimental-sqlite
|
|
||||||
'use strict';
|
'use strict';
|
||||||
require('../common');
|
require('../common');
|
||||||
const tmpdir = require('../common/tmpdir');
|
const tmpdir = require('../common/tmpdir');
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// Flags: --experimental-sqlite
|
|
||||||
'use strict';
|
'use strict';
|
||||||
require('../common');
|
require('../common');
|
||||||
const tmpdir = require('../common/tmpdir');
|
const tmpdir = require('../common/tmpdir');
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// Flags: --experimental-sqlite
|
|
||||||
'use strict';
|
'use strict';
|
||||||
const { spawnPromisified } = require('../common');
|
const { spawnPromisified } = require('../common');
|
||||||
const tmpdir = require('../common/tmpdir');
|
const tmpdir = require('../common/tmpdir');
|
||||||
@@ -23,13 +22,14 @@ suite('accessing the node:sqlite module', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test('cannot be accessed without --experimental-sqlite flag', async (t) => {
|
test('can be disabled with --no-experimental-sqlite flag', async (t) => {
|
||||||
const {
|
const {
|
||||||
stdout,
|
stdout,
|
||||||
stderr,
|
stderr,
|
||||||
code,
|
code,
|
||||||
signal,
|
signal,
|
||||||
} = await spawnPromisified(process.execPath, [
|
} = await spawnPromisified(process.execPath, [
|
||||||
|
'--no-experimental-sqlite',
|
||||||
'-e',
|
'-e',
|
||||||
'require("node:sqlite")',
|
'require("node:sqlite")',
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in new issue
Block a user