@@ -158,22 +158,23 @@ around [`sqlite3_prepare_v2()`][].
158158* ` options ` {Object} An optional object used to configure the session.
159159 * ` table ` {string} When provided, only changes to this table are tracked by the created session.
160160 By default, changes to all tables are tracked.
161- * ` db ` {string} Name of the database. Default: ` 'main' ` .
161+ * ` db ` {string} Name of the database to track . Default: ` 'main' ` .
162162* Returns: {Session} A session handle.
163163
164- Creates and attackes a session to the database. This method is a wrapper around [ ` sqlite3session_create() ` ] [ ] and [ ` sqlite3session_attach() ` ] [ ] .
164+ Creates and attaches a session to the database. This method is a wrapper around [ ` sqlite3session_create() ` ] [ ] and [ ` sqlite3session_attach() ` ] [ ] .
165165
166166### ` database.applyChangeset(changeset[, options]) `
167167
168- * ` changeset ` {Uint8Array} A binary changeset.
169- * ` options ` {Object} An optional object.
170- * ` filter ` {Function} Optional function that takes the name of a table as the first argument.
171- When ` true ` is returned, includes the change, otherwise, it is discarded . When not provided
172- no changes are filtered, and all are changes are attempted.
168+ * ` changeset ` {Uint8Array} A binary changeset or patchset .
169+ * ` options ` {Object} An optional object to configure how changes are applied .
170+ * ` filter ` {Function} Optional function that allows skipping changes based on the name of a table
171+ (passed as the first argument) based on a boolean returned . When not provided no changes are
172+ filtered, and all are changes are attempted.
173173 * ` onConflict ` {number} When provided, must be one of ` SQLITE_CHANGESET_OMIT ` ,
174174 ` SQLITE_CHANGESET_REPLACE ` or ` SQLITE_CHANGESET_ABORT ` . Determines how conflicts are handled.
175175 Conflicting changes are either omitted, changes replace existing values or the
176- call is aborted when the first conflicting change is encountered (this is the default).
176+ call is aborted when the first conflicting change is encountered. Aborting on
177+ conflict is the default when no value is provided for this option.
177178* Returns: {boolean} Whether the changeset was applied succesfully without being aborted.
178179
179180An exception is thrown if the database is not
@@ -195,7 +196,8 @@ insert.run(1, 'hello');
195196insert .run (2 , ' world' );
196197
197198const changeset = session .changeset ();
198- database2 .applyChangeset (changeset); // Will now contain the same data as database1
199+ database2 .applyChangeset (changeset);
200+ // Now database2 contains the same data as database1
199201```
200202
201203## Class: ` Session `
0 commit comments