SQLite: The Session Extension
10 hours ago
- #Database
- #Version Control
- #SQLite
- The session extension in SQLite records changes to tables and packages them into changeset or patchset files.
- Changesets can be applied to other databases with the same schema to merge changes.
- The extension supports INSERT, DELETE, and UPDATE operations but requires tables to have a PRIMARY KEY.
- NULL values in PRIMARY KEY columns are ignored by the session extension.
- Changesets can be inverted to 'undo' changes.
- The extension is included in SQLite since version 3.13.0 but is disabled by default.
- Prior to SQLite 3.17.0, the session extension only worked with rowid tables.
- Virtual tables are not supported by the session extension.
- Conflict resolution options are available when applying changesets.
- Example code demonstrates how to capture, apply, and iterate through changesets.