SqlitePorthole

The database porthole, for anything that is not Room.

Room was never what was being instrumented — SupportSQLiteOpenHelper was, and Room is only one of the things that opens a database through it. SQLDelight's AndroidSqliteDriver takes a factory, and so does anything else built on androidx.sqlite, so they can all be handed this one.

AndroidSqliteDriver(
schema = Schema,
context = context,
name = "cart.db",
factory = SqlitePorthole.factory(),
)

The instrumented database is what the caller ends up using, and a separate undecorated handle goes to the inspector, so reading a table to display it does not emit query events for the act of looking.

Functions

Link copied to clipboard
fun factory(delegate: SupportSQLiteOpenHelper.Factory = FrameworkSQLiteOpenHelperFactory(), captureBindArgs: Boolean = true, maxArgChars: Int = 64): SupportSQLiteOpenHelper.Factory