We are using Zetatic Version 4.5.0 with RoomDB Kotlin Android , Our Database taking 4 seconds to execute very simple query like SELECT * FROM TABLE ( this table have only one record)
is there any way to improve this? here is our implementation
fun provideDatabase(context: Context): AppDatabase {
Room.databaseBuilder(
context.applicationContext,
AppDatabase::class.java, DB_ENCRYPTED
)
.openHelperFactory(getSupportFactory())
.addMigrations(MIGRATION_X_Y)
.fallbackToDestructiveMigration()
.build()
}
private fun getSupportFactory(): SupportFactory {
val passPhrase: ByteArray = SQLiteDatabase.getBytes(DB_PASSPHRASE.toCharArray())
val hook = object : SQLiteDatabaseHook {
override fun preKey(database: SQLiteDatabase?) {}
override fun postKey(database: SQLiteDatabase?) {
database?.rawExecSQL("PRAGMA key = '$DB_PASSPHRASE';")
database?.rawExecSQL("PRAGMA cipher_migrate;")
}
}
return SupportFactory(passPhrase, hook)