| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a238230 commit 59e4087
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -156,6 +156,10 @@ around [`sqlite3_prepare_v2()`][]. | |||
| 156 | 156 | ||
| 157 | 157 | ### `database.createSession([options])` | |
| 158 | 158 | ||
| 159 | + <!-- YAML | ||
| 160 | + added: v23.3.0 | ||
| 161 | + --> | ||
| 162 | + | ||
| 159 | 163 | * `options` {Object} The configuration options for the session. | |
| 160 | 164 | * `table` {string} A specific table to track changes for. By default, changes to all tables are tracked. | |
| 161 | 165 | * `db` {string} Name of the database to track. This is useful when multiple databases have been added using [`ATTACH DATABASE`][]. **Default**: `'main'`. | |
@@ -165,14 +169,18 @@ Creates and attaches a session to the database. This method is a wrapper around | |||
| 165 | 169 | ||
| 166 | 170 | ### `database.applyChangeset(changeset[, options])` | |
| 167 | 171 | ||
| 172 | + <!-- YAML | ||
| 173 | + added: v23.3.0 | ||
| 174 | + --> | ||
| 175 | + | ||
| 168 | 176 | * `changeset` {Uint8Array} A binary changeset or patchset. | |
| 169 | 177 | * `options` {Object} The configuration options for how the changes will be applied. | |
| 170 | 178 | * `filter` {Function} Skip changes that, when targeted table name is supplied to this function, return a truthy value. | |
| 171 | 179 | By default, all changes are attempted. | |
| 172 | 180 | * `onConflict` {number} Determines how conflicts are handled. **Default**: `SQLITE_CHANGESET_ABORT`. | |
| 173 | 181 | * `SQLITE_CHANGESET_OMIT`: conflicting changes are omitted. | |
| 174 | 182 | * `SQLITE_CHANGESET_REPLACE`: conflicting changes replace existing values. | |
| 175 | - * `SQLITE_CHANGESET_ABORT`: abort on conflict and roll back databsase. | ||
| 183 | + * `SQLITE_CHANGESET_ABORT`: abort on conflict and roll back database. | ||
| 176 | 184 | * Returns: {boolean} Whether the changeset was applied succesfully without being aborted. | |
| 177 | 185 | ||
| 178 | 186 | An exception is thrown if the database is not | |
@@ -198,15 +206,27 @@ targetDb.applyChangeset(changeset); | |||
| 198 | 206 | ||
| 199 | 207 | ## Class: `Session` | |
| 200 | 208 | ||
| 209 | + <!-- YAML | ||
| 210 | + added: v23.3.0 | ||
| 211 | + --> | ||
| 212 | + | ||
| 201 | 213 | ### `session.changeset()` | |
| 202 | 214 | ||
| 215 | + <!-- YAML | ||
| 216 | + added: v23.3.0 | ||
| 217 | + --> | ||
| 218 | + | ||
| 203 | 219 | * Returns: {Uint8Array} Binary changeset that can be applied to other databases. | |
| 204 | 220 | ||
| 205 | 221 | Retrieves a changeset containing all changes since the changeset was created. Can be called multiple times. | |
| 206 | 222 | An exception is thrown if the database or the session is not open. This method is a wrapper around [`sqlite3session_changeset()`][]. | |
| 207 | 223 | ||
| 208 | 224 | ### `session.patchset()` | |
| 209 | 225 | ||
| 226 | + <!-- YAML | ||
| 227 | + added: v23.3.0 | ||
| 228 | + --> | ||
| 229 | + | ||
| 210 | 230 | * Returns: {Uint8Array} Binary patchset that can be applied to other databases. | |
| 211 | 231 | ||
| 212 | 232 | Similar to the method above, but generates a more compact patchset. See [Changesets and Patchsets][] | |
| Back | FazBrowse Home | New Git URL |
0 commit comments