Group writes and choose commit or rollback
#BEGIN is deferred by default; BEGIN IMMEDIATE attempts to acquire write capability earlier. SQLite permits one writer at a time, subject to connection/journal/busy settings. Commit/rollback and statement errors need explicit caller handling.
Fragment
SQL fragment for the sample items/categories tables in “Create sample records”. Run examples independently.