Andrew O Hart
12/03/2021, 3:53 PMNativeSqliteDriver(DatabaseConfiguration(
name = DatabaseName,
version = DatabaseSample.Schema.version,
create = { connection -> wrapConnection(connection) { DatabaseSample.Schema.create(it) } },
upgrade = { connection, oldVersion, newVersion -> wrapConnection(connection) { DatabaseSample.Schema.migrate(it, oldVersion, newVersion) } },
// Workaround for DatabaseConnection.setCipherKey causing an exception on iOS 14
configConnection = { connection, _ ->
val statement = "PRAGMA key = \"$password\";"
connection.withStatement(statement) {
stringForQuery()
}
}
))
However when I run it, I see migration is done fine, and I have an encrypted db in the container with the old values, however xcode gives me this issue:
attempted to run migration and failed. closing connection.
Function doesn't have or inherit @Throws annotation and thus exception isn't propagated from Kotlin to Objective-C/Swift as NSError.
It is considered unexpected and unhandled instead. Program will be terminated.
Uncaught Kotlin exception: kotlin.Exception: android/database/sqlite/SQLiteException - table TestTable already exists (code 1): , while compiling: CREATE TABLE TestTable (
Any ideas on what could fix this?