Skip to content

Commit 8fec2eb

Browse files
committed
sqlite: rename StatementSync to Statement
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
1 parent 26aa321 commit 8fec2eb

12 files changed

Lines changed: 209 additions & 201 deletions

‎doc/api/deprecations.md‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4815,6 +4815,20 @@ Type: Documentation-only
48154815
`node:sqlite`'s `DatabaseSync` class was renamed to `Database`. `DatabaseSync`
48164816
is kept as a deprecated alias. Use `Database` instead.
48174817
4818+
### DEP0211: `sqlite.StatementSync`
4819+
4820+
<!-- YAML
4821+
changes:
4822+
- version: REPLACEME
4823+
pr-url: https://github.com/nodejs/node/pull/65988
4824+
description: Documentation-only deprecation.
4825+
-->
4826+
4827+
Type: Documentation-only
4828+
4829+
`node:sqlite`'s `StatementSync` class was renamed to `Statement`.
4830+
`StatementSync` is kept as a deprecated alias. Use `Statement` instead.
4831+
48184832
[DEP0142]: #dep0142-repl_builtinlibs
48194833
[DEP0156]: #dep0156-aborted-property-and-abort-aborted-event-in-http
48204834
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf

‎doc/api/sqlite.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ changes:
741741
be retained for a long time and likely reused many times. SQLite currently
742742
responds to this hint by avoiding lookaside memory. Corresponds to the
743743
[`SQLITE_PREPARE_PERSISTENT`][] flag. **Default:** `false`.
744-
* Returns: {StatementSync} The prepared statement.
744+
* Returns: {Statement} The prepared statement.
745745

746746
Compiles a SQL statement into a [prepared statement][]. This method is a wrapper
747747
around [`sqlite3_prepare_v3()`][].
@@ -1151,7 +1151,7 @@ Closes the session. If the session is already closed, then this is a no-op. An
11511151
a changeset or patchset, or if the method is called from a callback that SQLite
11521152
invoked, under the same conditions as [`session.close()`][].
11531153
1154-
## Class: `StatementSync`
1154+
## Class: `Statement`
11551155
11561156
<!-- YAML
11571157
added: v22.5.0
@@ -1162,6 +1162,10 @@ instantiated via its constructor. Instead, instances are created via the
11621162
`database.prepare()` method. All APIs exposed by this class execute
11631163
synchronously.
11641164
1165+
`StatementSync` is a deprecated alias for `Statement`, kept for backward
1166+
compatibility with the class's previous name. See
1167+
[DEP0211](deprecations.md#dep0211-sqlitestatementsync).
1168+
11651169
A prepared statement is an efficient binary representation of the SQL used to
11661170
create it. Prepared statements are parameterizable, and can be invoked multiple
11671171
times with different bound values. Parameters also offer protection against

‎doc/type-map.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"Shareable": "stream_iter.html#interface-shareable",
126126
"Sign": "crypto.html#class-sign",
127127
"SQLTagStore": "sqlite.html#class-sqltagstore",
128-
"StatementSync": "sqlite.html#class-statementsync",
128+
"Statement": "sqlite.html#class-statement",
129129
"Stream": "stream.html#stream",
130130
"SubtleCrypto": "webcrypto.html#class-subtlecrypto",
131131
"SuiteContext": "test.html#class-suitecontext",

‎lib/sqlite.js‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
'use strict';
22

3-
const {
4-
Database,
5-
StatementSync,
6-
Session,
7-
constants,
8-
backup,
9-
} = internalBinding('sqlite');
3+
const { Database, Statement, Session, constants, backup } =
4+
internalBinding('sqlite');
105

116
module.exports = {
127
Database,
138
// DEP0210: Documentation-only deprecation, kept for backward
149
// compatibility with the class's pre-rename name.
1510
DatabaseSync: Database,
16-
StatementSync,
11+
Statement,
12+
// DEP0211: Documentation-only deprecation, kept for backward
13+
// compatibility with the class's pre-rename name.
14+
StatementSync: Statement,
1715
Session,
1816
constants,
1917
backup,

0 commit comments

Comments
 (0)