Wondering if anyone can add some color to the advi...
# squarelibraries
d
Wondering if anyone can add some color to the advice in the SQLDelight docs that states
If the driver supports it, migrations are run in a transaction. You should not surround your migrations in
BEGIN/END TRANSACTION
, as this can cause a crash with some drivers.
We have hundreds of migrations in our app that start with
BEGIN TRANSACTION
and end with
COMMIT
that have worked fine. Recently, we encountered an upgrade that triggered a
android.database.sqlite.SQLiteDatabaseLockedException: database is locked (code 5 SQLITE_BUSY[5])
exception, and removing this fixed it. Do all migrations on Android already run in a transaction? Was looking at the driver code, and couldn't see where that is done. Is this advice accurate? Should we remove
BEGIN TRANSACTION
from our existing migration files to be safe, and continue avoiding it going forward?