calidion
01/25/2025, 5:41 PMCannot create a RoomDatabase without providing a SQLiteDriver via setDriver().
I have added these lines:
val roomVersion = "2.7.0-alpha12"
implementation("androidx.room:room-runtime:$roomVersion")
implementation("androidx.sqlite:sqlite-bundled:2.5.0-alpha12")
implementation("androidx.sqlite:sqlite-bundled-jvm:2.5.0-alpha12")
ksp("androidx.room:room-compiler:$roomVersion")
creation code:
fun getDatabaseBuilder(): RoomDatabase.Builder<AppDatabase> {
val dbFile = File(System.getProperty("java.io.tmpdir"), "my_room.db")
return Room.databaseBuilder<AppDatabase>(
name = dbFile.absolutePath,
)
}
Chrimaeon
01/25/2025, 6:16 PMcalidion
01/25/2025, 6:42 PMcalidion
01/25/2025, 6:43 PMcalidion
01/25/2025, 6:44 PMreturn builder
// .addMigrations(MIGRATIONS)
// .fallbackToDestructiveMigrationOnDowngrade()
.setDriver(BundledSQLiteDriver())
.setQueryCoroutineContext(<http://Dispatchers.IO|Dispatchers.IO>)
.build()
Chrimaeon
01/25/2025, 6:53 PMcalidion
01/25/2025, 7:22 PM