Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: clarify sqlite user-defined function behaviour #56786

Merged
merged 1 commit into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions doc/api/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,14 @@ added:
* `useBigIntArguments` {boolean} If `true`, integer arguments to `function`
are converted to `BigInt`s. If `false`, integer arguments are passed as
JavaScript numbers. **Default:** `false`.
* `varargs` {boolean} If `true`, `function` can accept a variable number of
arguments. If `false`, `function` must be invoked with exactly
`function.length` arguments. **Default:** `false`.
* `varargs` {boolean} If `true`, `function` may be invoked with any number of
arguments (between zero and [`SQLITE_MAX_FUNCTION_ARG`][]). If `false`,
`function` must be invoked with exactly `function.length` arguments.
**Default:** `false`.
* `function` {Function} The JavaScript function to call when the SQLite
function is invoked.
function is invoked. The return value of this function should be a valid
SQLite data type: see [Type conversion between JavaScript and SQLite][].
The result defaults to `NULL` if the return value is `undefined`.

This method is used to create SQLite user-defined functions. This method is a
wrapper around [`sqlite3_create_function_v2()`][].
Expand Down Expand Up @@ -599,10 +602,12 @@ resolution handler passed to [`database.applyChangeset()`][]. See also
[Constants Passed To The Conflict Handler]: https://www.sqlite.org/session/c_changeset_conflict.html
[Constants Returned From The Conflict Handler]: https://www.sqlite.org/session/c_changeset_abort.html
[SQL injection]: https://en.wikipedia.org/wiki/SQL_injection
[Type conversion between JavaScript and SQLite]: #type-conversion-between-javascript-and-sqlite
[`ATTACH DATABASE`]: https://www.sqlite.org/lang_attach.html
[`PRAGMA foreign_keys`]: https://www.sqlite.org/pragma.html#pragma_foreign_keys
[`SQLITE_DETERMINISTIC`]: https://www.sqlite.org/c3ref/c_deterministic.html
[`SQLITE_DIRECTONLY`]: https://www.sqlite.org/c3ref/c_deterministic.html
[`SQLITE_MAX_FUNCTION_ARG`]: https://www.sqlite.org/limits.html#max_function_arg
[`database.applyChangeset()`]: #databaseapplychangesetchangeset-options
[`sqlite3_changes64()`]: https://www.sqlite.org/c3ref/changes.html
[`sqlite3_close_v2()`]: https://www.sqlite.org/c3ref/close.html
Expand Down
Loading