Search notes:
SQLite: transactions
By default, SQLite is in autocommit mode. In autocommit mode, each DML statement is committed when it finishes.
With begin
(or the more verbose but equivalent begin transaction
) statement, SQLite is taken out of autocommit mode.
Rolling back a create table
--
-- Unlike Oracle, the effect of "create table" statement
-- can be rolled back.
--
create table table_one (a);
begin transaction;
create table table_two(b);
create table table_three(b);
rollback;
.tables
--
-- table_one
drop table table_one;