Creating a Savepoint¶
A savepoint is a named marker inside a transaction. Once you have set one, you can undo everything done after it โ with a rollback to that savepoint โ without discarding the rest of the transaction. Savepoints are SQLite's way of nesting transactions, and are useful when a long sequence of changes has distinct stages you might want to unwind individually.
To create a savepoint:
- Select the database in the tree panel.
- Choose Transaction โ Savepoint from the main menu.
- Enter a name for the savepoint and click OK.
You can also create one from a script with the SAVEPOINT command:
SAVEPOINT before_import;
INSERT INTO customer (CustNo, Company, City) VALUES (9001, 'Blue Lagoon Divers', 'Male');
Note
A savepoint can be created inside an existing transaction, or on its own. If no transaction is active, the first SAVEPOINT starts one automatically, and nothing is written to disk until you release or commit the outermost level.
See also: Releasing a savepoint ยท Rolling back to a savepoint