Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc,lib,src,test: unflag sqlite module #55890

Merged
merged 1 commit into from
Nov 19, 2024
Merged
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
22 changes: 13 additions & 9 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -1065,14 +1065,6 @@ added:

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

### `--experimental-sqlite`

<!-- YAML
added: v22.5.0
-->

Enable the experimental [`node:sqlite`][] module.

### `--experimental-strip-types`

<!-- YAML
Expand Down Expand Up @@ -1693,6 +1685,18 @@ Disable support for loading a synchronous ES module graph in `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`

<!-- YAML
Expand Down Expand Up @@ -3043,7 +3047,6 @@ one is included in the list below.
* `--experimental-require-module`
* `--experimental-shadow-realm`
* `--experimental-specifier-resolution`
* `--experimental-sqlite`
* `--experimental-strip-types`
* `--experimental-top-level-await`
* `--experimental-transform-types`
Expand Down Expand Up @@ -3080,6 +3083,7 @@ one is included in the list below.
* `--no-deprecation`
* `--no-experimental-global-navigator`
* `--no-experimental-repl-await`
* `--no-experimental-sqlite`
* `--no-experimental-websocket`
* `--no-extra-info-on-fatal-exception`
* `--no-force-async-hooks-checks`
Expand Down
4 changes: 1 addition & 3 deletions doc/api/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
added: v22.5.0
-->

> Stability: 1.1 - Active development. Enable this API with the
> [`--experimental-sqlite`][] CLI flag.
> Stability: 1.1 - Active development.

<!-- source_link=lib/sqlite.js -->

Expand Down Expand Up @@ -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
[SQL injection]: https://en.wikipedia.org/wiki/SQL_injection
[`--experimental-sqlite`]: cli.md#--experimental-sqlite
[`ATTACH DATABASE`]: https://www.sqlite.org/lang_attach.html
[`PRAGMA foreign_keys`]: https://www.sqlite.org/pragma.html#pragma_foreign_keys
[`sqlite3_changes64()`]: https://www.sqlite.org/c3ref/changes.html
Expand Down
6 changes: 3 additions & 3 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,6 @@ Enable the experimental permission model.
.It Fl -experimental-shadow-realm
Use this flag to enable ShadowRealm support.
.
.It Fl -experimental-sqlite
Enable the experimental node:sqlite module.
.
.It Fl -experimental-test-coverage
Enable code coverage in the test runner.
.
Expand Down Expand Up @@ -215,6 +212,9 @@ Enable experimental support for the Web Storage API.
.It Fl -no-experimental-repl-await
Disable top-level await keyword support in REPL.
.
.It Fl -no-experimental-sqlite
Disable the experimental node:sqlite module.
.
.It Fl -experimental-vm-modules
Enable experimental ES module support in VM module.
.
Expand Down
2 changes: 1 addition & 1 deletion lib/internal/process/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ function setupNavigator() {
}

function setupSQLite() {
if (!getOptionValue('--experimental-sqlite')) {
if (getOptionValue('--no-experimental-sqlite')) {
return;
}

Expand Down
3 changes: 2 additions & 1 deletion src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() {
AddOption("--experimental-sqlite",
"experimental node:sqlite module",
&EnvironmentOptions::experimental_sqlite,
kAllowedInEnvvar);
kAllowedInEnvvar,
true);
AddOption("--experimental-webstorage",
"experimental Web Storage API",
&EnvironmentOptions::experimental_webstorage,
Expand Down
2 changes: 1 addition & 1 deletion src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class EnvironmentOptions : public Options {
bool experimental_eventsource = false;
bool experimental_fetch = true;
bool experimental_websocket = true;
bool experimental_sqlite = false;
bool experimental_sqlite = true;
bool experimental_webstorage = false;
std::string localstorage_file;
bool experimental_global_navigator = true;
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-sqlite-data-types.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --experimental-sqlite
'use strict';
require('../common');
const tmpdir = require('../common/tmpdir');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-sqlite-database-sync.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --experimental-sqlite
'use strict';
require('../common');
const tmpdir = require('../common/tmpdir');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-sqlite-named-parameters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --experimental-sqlite
'use strict';
require('../common');
const tmpdir = require('../common/tmpdir');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-sqlite-statement-sync.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --experimental-sqlite
'use strict';
require('../common');
const tmpdir = require('../common/tmpdir');
Expand Down
1 change: 0 additions & 1 deletion test/parallel/test-sqlite-transactions.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --experimental-sqlite
'use strict';
require('../common');
const tmpdir = require('../common/tmpdir');
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-sqlite.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Flags: --experimental-sqlite
'use strict';
const { spawnPromisified } = require('../common');
const tmpdir = require('../common/tmpdir');
Expand All @@ -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 {
stdout,
stderr,
code,
signal,
} = await spawnPromisified(process.execPath, [
'--no-experimental-sqlite',
'-e',
'require("node:sqlite")',
]);
Expand Down
Loading