Skip to content

Commit af289a3

Browse files
committed
doc: fix bare named parameters and bigint
1 parent eb93869 commit af289a3

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

doc/api/sqlite.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,11 @@ exception.
9999
| `TEXT` | {string} | {string} |
100100
| `BLOB` | {TypedArray}, {DataView}, {ArrayBuffer}, or {SharedArrayBuffer} | {Uint8Array} |
101101

102-
Booleans are written as the `INTEGER` values `1` and `0`, and are read back as
103-
numbers. Writing a {bigint} that does not fit in a signed 64-bit integer throws
104-
an `ERR_INVALID_ARG_VALUE` error.
102+
Booleans are written as the `INTEGER` values `1` and `0`. Like any other
103+
`INTEGER` value, they are read back as {number} by default, or as {bigint}
104+
values (`1n` and `0n`) when reading BigInts is enabled. Writing a {bigint} that
105+
does not fit in a signed 64-bit integer throws an `ERR_INVALID_ARG_VALUE`
106+
error.
105107

106108
APIs that read values from SQLite have a configuration option that determines
107109
whether `INTEGER` values are converted to `number` or `bigint` in JavaScript,
@@ -1193,14 +1195,15 @@ added: v22.5.0
11931195
* `enabled` {boolean} Enables or disables support for binding named parameters
11941196
without the prefix character.
11951197

1196-
The names of SQLite parameters begin with a prefix character. By default,
1197-
`node:sqlite` requires that this prefix character is present when binding
1198-
parameters. However, with the exception of dollar sign character, these
1199-
prefix characters also require extra quoting when used in object keys.
1198+
The names of SQLite parameters begin with a prefix character. However, with the
1199+
exception of the dollar sign character, these prefix characters also require
1200+
extra quoting when used in object keys.
12001201

1201-
To improve ergonomics, this method can be used to also allow bare named
1202-
parameters, which do not require the prefix character in JavaScript code. There
1203-
are several caveats to be aware of when enabling bare named parameters:
1202+
To improve ergonomics, `node:sqlite` allows bare named parameters, which do not
1203+
require the prefix character in JavaScript code, by default. This method can be
1204+
used to disable that behavior, requiring the prefix character when binding.
1205+
There are several caveats to be aware of when bare named parameters are
1206+
allowed:
12041207

12051208
* The prefix character is still required in SQL.
12061209
* The prefix character is still allowed in JavaScript. In fact, prefixed names

0 commit comments

Comments
 (0)