SQLiter icon indicating copy to clipboard operation
SQLiter copied to clipboard

Synchronous.NORMAL does not work when JournalMode.DELETE

Open marcardar opened this issue 4 months ago • 0 comments

sqliter1.3.1 (via sqldelight 2.0.0)

On iOS, when using Synchronous.NORMAL and JournalMode.DELETE together I get:

co.touchlab.sqliter.interop.SQLiteExceptionErrorCode: error while compiling: PRAGMA synchronous=1
file is not a database
    at 0   cmn.debug.dylib                     0x10c6642cb        kfun:kotlin.Throwable#<init>(kotlin.String?){} + 99 
    at 1   cmn.debug.dylib                     0x10c65e10b        kfun:kotlin.Exception#<init>(kotlin.String?){} + 95 
    at 2   cmn.debug.dylib                     0x10e152e57        kfun:co.touchlab.sqliter.interop.SQLiteException#<init>(kotlin.String;co.touchlab.sqliter.interop.SqliteDatabaseConfig){} + 115 
    at 3   cmn.debug.dylib                     0x10e152f4f        kfun:co.touchlab.sqliter.interop.SQLiteExceptionErrorCode#<init>(kotlin.String;co.touchlab.sqliter.interop.SqliteDatabaseConfig;kotlin.Int){} + 203 
    at 4   cmn.debug.dylib                     0x10e15606f        kfun:co.touchlab.sqliter.interop.SqliteDatabase#prepareStatement(kotlin.String){}co.touchlab.sqliter.interop.SqliteStatement + 2299 
    at 5   cmn.debug.dylib                     0x10e161117        kfun:co.touchlab.sqliter.native.NativeDatabaseConnection#createStatement(kotlin.String){}co.touchlab.sqliter.Statement + 223 
    at 6   cmn.debug.dylib                     0x10e166a83        kfun:co.touchlab.sqliter.DatabaseConnection#createStatement(kotlin.String){}co.touchlab.sqliter.Statement-trampoline + 107 
    at 7   cmn.debug.dylib                     0x10e144f9f        kfun:co.touchlab.sqliter#withStatement__at__co.touchlab.sqliter.DatabaseConnection(kotlin.String;kotlin.Function1<co.touchlab.sqliter.Statement,0:0>){0§<kotlin.Any?>}0:0 + 235 
    at 8   cmn.debug.dylib                     0x10e145ee3        kfun:co.touchlab.sqliter#updateSynchronousFlag__at__co.touchlab.sqliter.DatabaseConnection(co.touchlab.sqliter.SynchronousFlag){} + 251 
    at 9   cmn.debug.dylib                     0x10e16338f        kfun:co.touchlab.sqliter.native.NativeDatabaseManager.createConnection#internal + 1575 
    at 10  cmn.debug.dylib                     0x10e162a6b        kfun:co.touchlab.sqliter.native.NativeDatabaseManager#createMultiThreadedConnection(){}co.touchlab.sqliter.DatabaseConnection + 243 
    at 11  cmn.debug.dylib                     0x10e167123        kfun:co.touchlab.sqliter.DatabaseManager#createMultiThreadedConnection(){}co.touchlab.sqliter.DatabaseConnection-trampoline + 99 
    at 12  cmn.debug.dylib                     0x10e16dd13        kfun:app.cash.sqldelight.driver.native.NativeSqliteDriver.NativeSqliteDriver$2.invoke#internal + 243 
    at 13  cmn.debug.dylib                     0x10c7aef73        kfun:kotlin.Function0#invoke(){}1:0-trampoline + 99 
    at 14  cmn.debug.dylib                     0x10e1722bf        kfun:app.cash.sqldelight.driver.native.Pool.Pool$borrowEntry$nextAvailable$1.invoke#internal + 663 
    at 15  cmn.debug.dylib                     0x10c7af8cf        kfun:kotlin.Function1#invoke(1:0){}1:1-trampoline + 107 
    at 16  cmn.debug.dylib                     0x10e16a6d3        kfun:app.cash.sqldelight.driver.native.util.PoolLock#withLock(kotlin.Function1<app.cash.sqldelight.driver.native.util.PoolLock.CriticalSection,0:0>){0§<kotlin.Any?>}0:0 + 535 
    at 17  cmn.debug.dylib                     0x10e171153        kfun:app.cash.sqldelight.driver.native.Pool#borrowEntry(){}app.cash.sqldelight.driver.native.Borrowed<1:0> + 847 
    at 18  cmn.debug.dylib                     0x10e16d1c7        kfun:app.cash.sqldelight.driver.native.NativeSqliteDriver#newTransaction(){}app.cash.sqldelight.db.QueryResult<app.cash.sqldelight.Transacter.Transaction> + 379 
    at 19  cmn.debug.dylib                     0x10e139a5f        kfun:app.cash.sqldelight.db.SqlDriver#newTransaction(){}app.cash.sqldelight.db.QueryResult<app.cash.sqldelight.Transacter.Transaction>-trampoline + 99 
    at 20  cmn.debug.dylib                     0x10e136fc3        kfun:app.cash.sqldelight.TransacterImpl.transactionWithWrapper#internal + 379 
    at 21  cmn.debug.dylib                     0x10e136d73        kfun:app.cash.sqldelight.TransacterImpl#transaction(kotlin.Boolean;kotlin.Function1<app.cash.sqldelight.TransactionWithoutReturn,kotlin.Unit>){} + 171 
    at 22  cmn.debug.dylib                     0x10e13967f        kfun:app.cash.sqldelight.Transacter#transaction(kotlin.Boolean;kotlin.Function1<app.cash.sqldelight.TransactionWithoutReturn,kotlin.Unit>){}-trampoline + 111 

Workaround is to use synchronousFlag = null when journalMode = JournalMode.DELETE (actually this might not be a workaround, since I've only opened a database with this configuration, not yet written to one)

marcardar avatar Oct 14 '25 12:10 marcardar