Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 91638ee

Browse filesBrowse files
Renegade334targos
authored andcommitted
doc: clarify sqlite user-defined function behaviour
PR-URL: #56786 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
1 parent 0f553e5 commit 91638ee
Copy full SHA for 91638ee

File tree

Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+9
-4
lines changed
Open diff view settings
Collapse file

‎doc/api/sqlite.md‎

Copy file name to clipboardExpand all lines: doc/api/sqlite.md
+9-4Lines changed: 9 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,14 @@ added: v23.5.0
176176
* `useBigIntArguments` {boolean} If `true`, integer arguments to `function`
177177
are converted to `BigInt`s. If `false`, integer arguments are passed as
178178
JavaScript numbers. **Default:** `false`.
179-
* `varargs` {boolean} If `true`, `function` can accept a variable number of
180-
arguments. If `false`, `function` must be invoked with exactly
181-
`function.length` arguments. **Default:** `false`.
179+
* `varargs` {boolean} If `true`, `function` may be invoked with any number of
180+
arguments (between zero and [`SQLITE_MAX_FUNCTION_ARG`][]). If `false`,
181+
`function` must be invoked with exactly `function.length` arguments.
182+
**Default:** `false`.
182183
* `function` {Function} The JavaScript function to call when the SQLite
183-
function is invoked.
184+
function is invoked. The return value of this function should be a valid
185+
SQLite data type: see [Type conversion between JavaScript and SQLite][].
186+
The result defaults to `NULL` if the return value is `undefined`.
184187

185188
This method is used to create SQLite user-defined functions. This method is a
186189
wrapper around [`sqlite3_create_function_v2()`][].
@@ -579,10 +582,12 @@ resolution handler passed to [`database.applyChangeset()`][]. See also
579582
[Constants Passed To The Conflict Handler]: https://www.sqlite.org/session/c_changeset_conflict.html
580583
[Constants Returned From The Conflict Handler]: https://www.sqlite.org/session/c_changeset_abort.html
581584
[SQL injection]: https://en.wikipedia.org/wiki/SQL_injection
585+
[Type conversion between JavaScript and SQLite]: #type-conversion-between-javascript-and-sqlite
582586
[`ATTACH DATABASE`]: https://www.sqlite.org/lang_attach.html
583587
[`PRAGMA foreign_keys`]: https://www.sqlite.org/pragma.html#pragma_foreign_keys
584588
[`SQLITE_DETERMINISTIC`]: https://www.sqlite.org/c3ref/c_deterministic.html
585589
[`SQLITE_DIRECTONLY`]: https://www.sqlite.org/c3ref/c_deterministic.html
590+
[`SQLITE_MAX_FUNCTION_ARG`]: https://www.sqlite.org/limits.html#max_function_arg
586591
[`database.applyChangeset()`]: #databaseapplychangesetchangeset-options
587592
[`sqlite3_changes64()`]: https://www.sqlite.org/c3ref/changes.html
588593
[`sqlite3_close_v2()`]: https://www.sqlite.org/c3ref/close.html

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.