doc: add added tag and fix typo sqlite.md

PR-URL: https://github.com/nodejs/node/pull/56012
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
Bart Louwers authored and GitHub committed 2024-11-27 20:56:40 +00:00
1 parent 24a8662359
commit 853b304db8
1 file changed
+21 -1
+21 -1
View File
@@ -156,6 +156,10 @@ around [`sqlite3_prepare_v2()`][].
### `database.createSession([options])`
<!-- YAML
added: v23.3.0
-->
* `options` {Object} The configuration options for the session.
* `table` {string} A specific table to track changes for. By default, changes to all tables are tracked.
* `db` {string} Name of the database to track. This is useful when multiple databases have been added using [`ATTACH DATABASE`][]. **Default**: `'main'`.
@@ -165,6 +169,10 @@ Creates and attaches a session to the database. This method is a wrapper around
### `database.applyChangeset(changeset[, options])`
<!-- YAML
added: v23.3.0
-->
* `changeset` {Uint8Array} A binary changeset or patchset.
* `options` {Object} The configuration options for how the changes will be applied.
* `filter` {Function} Skip changes that, when targeted table name is supplied to this function, return a truthy value.
@@ -172,7 +180,7 @@ Creates and attaches a session to the database. This method is a wrapper around
* `onConflict` {number} Determines how conflicts are handled. **Default**: `SQLITE_CHANGESET_ABORT`.
* `SQLITE_CHANGESET_OMIT`: conflicting changes are omitted.
* `SQLITE_CHANGESET_REPLACE`: conflicting changes replace existing values.
* `SQLITE_CHANGESET_ABORT`: abort on conflict and roll back databsase.
* `SQLITE_CHANGESET_ABORT`: abort on conflict and roll back database.
* Returns: {boolean} Whether the changeset was applied succesfully without being aborted.
An exception is thrown if the database is not
@@ -198,8 +206,16 @@ targetDb.applyChangeset(changeset);
## Class: `Session`
<!-- YAML
added: v23.3.0
-->
### `session.changeset()`
<!-- YAML
added: v23.3.0
-->
* Returns: {Uint8Array} Binary changeset that can be applied to other databases.
Retrieves a changeset containing all changes since the changeset was created. Can be called multiple times.
@@ -207,6 +223,10 @@ An exception is thrown if the database or the session is not open. This method i
### `session.patchset()`
<!-- YAML
added: v23.3.0
-->
* Returns: {Uint8Array} Binary patchset that can be applied to other databases.
Similar to the method above, but generates a more compact patchset. See [Changesets and Patchsets][]