Android Room ORM: Support custom build of SQLite

Viewed 2053

I need to use a custom build of SQLite (based on sqlite.org version https://sqlite.org/android/doc/trunk/www/index.wiki) so that I can use custom FTS Tokenizers and to use SEE to encrypt my databases.

I'm using the following code to create a Room database:

val mainDb = Room.databaseBuilder(context, MainDatabase::class.java, "main")
                .openHelperFactory(SqliteOrgSQLiteOpenHelperFactory())
                .build()

I tried to implement my own "SupportSQLiteOpenHelper.Factory" (SqliteOrgSQLiteOpenHelperFactory) and tried to implement all of the needed classes, but there are too many direct dependencies to "android.database." and "android.database.sqlite.". All of these dependencies seem to need to be wrapped in "SupportXXX" classes

Example: SupportSQLiteOpenHelper.Configuration depends on:

  • android.database.DatabaseErrorHandler
  • android.database.DefaultDatabaseErrorHandler
  • android.database.sqlite.SQLiteDatabase.CursorFactory

SupportSQLiteDatabase depends on:

  • android.database.sqlite.SQLiteTransactionListener
  • android.database.sqlite.SQLiteDatabase.CursorFactory

Am I missing something? Am I approaching this all wrong?

1 Answers
Related