BEGIN
The SQL statement that starts a transaction, so the following statements form one unit.
In more detail
Without BEGIN, each statement is its own transaction and commits immediately. SQLite's BEGIN can be deferred, immediate or exclusive, which controls when it takes the lock that lets it write.
Example
In this course: a database test fixture can run BEGIN, hand the connection to the test and ROLLBACK afterwards.Related terms
- transaction — A group of database changes that succeed or fail together, so the data is never left half-updated.
- COMMIT — The SQL statement that ends a transaction and makes all its changes permanent and visible to others.
- ROLLBACK — The SQL statement that ends a transaction by undoing every change made since it began.
Taught in
- Transactions And ACID Properties — PostgreSQL, Indexing & Relational Data Modeling
- Testing With Real Databases — Automated Testing, TDD & Quality Engineering