Skip to content

Commit e44f4c1

Browse files
committed
doc: clarify sqlite numbered parameters
Signed-off-by: Guilherme Araújo <arauujogui@gmail.com>
1 parent 2dc5378 commit e44f4c1

1 file changed

Lines changed: 55 additions & 2 deletions

File tree

doc/api/sqlite.md

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -984,8 +984,9 @@ the parameters of the prepared statement before executing it. Parameters are
984984
either anonymous or named.
985985

986986
Anonymous parameters are written as `?` in SQL and are bound in order from the
987-
arguments passed to the method. The `?NNN` form assigns an explicit number to a
988-
placeholder, binding it to the argument at position `NNN`.
987+
arguments passed to the method. The `?NNN` form assigns SQLite parameter index
988+
`NNN` to a placeholder. Avoid mixing numbered and named parameters because they
989+
share parameter indexes.
989990

990991
```js
991992
db.prepare('SELECT ? AS a, ? AS b').get('x', 42);
@@ -1025,6 +1026,12 @@ bound. Binding any other value throws an `ERR_INVALID_ARG_TYPE` error.
10251026
<!-- YAML
10261027
added: v22.5.0
10271028
changes:
1029+
- version: REPLACEME
1030+
pr-url: https://github.com/nodejs/node/pull/62001
1031+
description: Add support for boolean values in bound parameters.
1032+
- version: REPLACEME
1033+
pr-url: https://github.com/nodejs/node/pull/62061
1034+
description: Add support for `ArrayBuffer` and `SharedArrayBuffer` objects in bound parameters.
10281035
- version:
10291036
- v23.7.0
10301037
- v22.14.0
@@ -1102,6 +1109,12 @@ execution of this prepared statement. This property is a wrapper around
11021109
<!-- YAML
11031110
added: v22.5.0
11041111
changes:
1112+
- version: REPLACEME
1113+
pr-url: https://github.com/nodejs/node/pull/62001
1114+
description: Add support for boolean values in bound parameters.
1115+
- version: REPLACEME
1116+
pr-url: https://github.com/nodejs/node/pull/62061
1117+
description: Add support for `ArrayBuffer` and `SharedArrayBuffer` objects in bound parameters.
11051118
- version:
11061119
- v23.7.0
11071120
- v22.14.0
@@ -1131,6 +1144,12 @@ added:
11311144
- v23.4.0
11321145
- v22.13.0
11331146
changes:
1147+
- version: REPLACEME
1148+
pr-url: https://github.com/nodejs/node/pull/62001
1149+
description: Add support for boolean values in bound parameters.
1150+
- version: REPLACEME
1151+
pr-url: https://github.com/nodejs/node/pull/62061
1152+
description: Add support for `ArrayBuffer` and `SharedArrayBuffer` objects in bound parameters.
11341153
- version:
11351154
- v23.7.0
11361155
- v22.14.0
@@ -1157,6 +1176,12 @@ the values in `namedParameters` and `anonymousParameters`. See
11571176
<!-- YAML
11581177
added: v22.5.0
11591178
changes:
1179+
- version: REPLACEME
1180+
pr-url: https://github.com/nodejs/node/pull/62001
1181+
description: Add support for boolean values in bound parameters.
1182+
- version: REPLACEME
1183+
pr-url: https://github.com/nodejs/node/pull/62061
1184+
description: Add support for `ArrayBuffer` and `SharedArrayBuffer` objects in bound parameters.
11601185
- version:
11611186
- v23.7.0
11621187
- v22.14.0
@@ -1295,6 +1320,13 @@ class execute synchronously.
12951320

12961321
<!-- YAML
12971322
added: v24.9.0
1323+
changes:
1324+
- version: REPLACEME
1325+
pr-url: https://github.com/nodejs/node/pull/62001
1326+
description: Add support for boolean values in bound parameters.
1327+
- version: REPLACEME
1328+
pr-url: https://github.com/nodejs/node/pull/62061
1329+
description: Add support for `ArrayBuffer` and `SharedArrayBuffer` objects in bound parameters.
12981330
-->
12991331

13001332
- `stringElements` {string\[]} Template literal elements containing the SQL
@@ -1313,6 +1345,13 @@ called directly.
13131345

13141346
<!-- YAML
13151347
added: v24.9.0
1348+
changes:
1349+
- version: REPLACEME
1350+
pr-url: https://github.com/nodejs/node/pull/62001
1351+
description: Add support for boolean values in bound parameters.
1352+
- version: REPLACEME
1353+
pr-url: https://github.com/nodejs/node/pull/62061
1354+
description: Add support for `ArrayBuffer` and `SharedArrayBuffer` objects in bound parameters.
13161355
-->
13171356

13181357
- `stringElements` {string\[]} Template literal elements containing the SQL
@@ -1331,6 +1370,13 @@ called directly.
13311370

13321371
<!-- YAML
13331372
added: v24.9.0
1373+
changes:
1374+
- version: REPLACEME
1375+
pr-url: https://github.com/nodejs/node/pull/62001
1376+
description: Add support for boolean values in bound parameters.
1377+
- version: REPLACEME
1378+
pr-url: https://github.com/nodejs/node/pull/62061
1379+
description: Add support for `ArrayBuffer` and `SharedArrayBuffer` objects in bound parameters.
13341380
-->
13351381

13361382
- `stringElements` {string\[]} Template literal elements containing the SQL
@@ -1348,6 +1394,13 @@ called directly.
13481394

13491395
<!-- YAML
13501396
added: v24.9.0
1397+
changes:
1398+
- version: REPLACEME
1399+
pr-url: https://github.com/nodejs/node/pull/62001
1400+
description: Add support for boolean values in bound parameters.
1401+
- version: REPLACEME
1402+
pr-url: https://github.com/nodejs/node/pull/62061
1403+
description: Add support for `ArrayBuffer` and `SharedArrayBuffer` objects in bound parameters.
13511404
-->
13521405

13531406
- `stringElements` {string\[]} Template literal elements containing the SQL

0 commit comments

Comments
 (0)