mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
sqlite: make sourceSQL and expandedSQL string-valued properties
Change sourceSQL and expandedSQL from being methods to being string-valued properties. These fields - are conceptually properties (and not actions), - are derived deterministically from the current state of the object, - require no parameters, and - are inexpensive to compute. Also, following the naming conventions of ECMAScript for new features, most function names should usually contain a verb, whereas names of (dynamically computed) properties generally should not, so the current names also seem more appropriate for properties than for functions. PR-URL: https://github.com/nodejs/node/pull/54721 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
a49abec6c3
commit
7af434fc19
4 files changed
+47
-19
No files matched your search
+7
-7
@@ -194,17 +194,17 @@ objects. If the prepared statement does not return any results, this method
|
||||
returns an empty array. The prepared statement [parameters are bound][] using
|
||||
the values in `namedParameters` and `anonymousParameters`.
|
||||
|
||||
### `statement.expandedSQL()`
|
||||
### `statement.expandedSQL`
|
||||
|
||||
<!-- YAML
|
||||
added: v22.5.0
|
||||
-->
|
||||
|
||||
* Returns: {string} The source SQL expanded to include parameter values.
|
||||
* {string} The source SQL expanded to include parameter values.
|
||||
|
||||
This method returns the source SQL of the prepared statement with parameter
|
||||
The source SQL text of the prepared statement with parameter
|
||||
placeholders replaced by the values that were used during the most recent
|
||||
execution of this prepared statement. This method is a wrapper around
|
||||
execution of this prepared statement. This property is a wrapper around
|
||||
[`sqlite3_expanded_sql()`][].
|
||||
|
||||
### `statement.get([namedParameters][, ...anonymousParameters])`
|
||||
@@ -293,15 +293,15 @@ be used to read `INTEGER` data using JavaScript `BigInt`s. This method has no
|
||||
impact on database write operations where numbers and `BigInt`s are both
|
||||
supported at all times.
|
||||
|
||||
### `statement.sourceSQL()`
|
||||
### `statement.sourceSQL`
|
||||
|
||||
<!-- YAML
|
||||
added: v22.5.0
|
||||
-->
|
||||
|
||||
* Returns: {string} The source SQL used to create this prepared statement.
|
||||
* {string} The source SQL used to create this prepared statement.
|
||||
|
||||
This method returns the source SQL of the prepared statement. This method is a
|
||||
The source SQL text of the prepared statement. This property is a
|
||||
wrapper around [`sqlite3_sql()`][].
|
||||
|
||||
### Type conversion between JavaScript and SQLite
|
||||
|
||||
Reference in new issue
Block a user