Mark
02/08/2021, 1:55 AMSupportSQLiteOpenHelper
but what if the database is read-only (as in, you never want to modify it)? Are there any best practices/optimizations for opening such a database? I know there are some cases where readableDatabase
returns a non-null value when writeableDatabase
returns null, so there could be cases where it makes more sense to call readableDatabase
. A nasty workaround is to override the helper so that the result of readableDatabase
is returned when writeableDatabase
is called. https://github.com/cashapp/sqldelight/blob/51e0621abe103761717d3d9078dcde3734ad8c0[…]ain/java/com/squareup/sqldelight/android/AndroidSqliteDriver.ktjw
02/13/2021, 5:15 PMMark
02/15/2021, 1:07 PMMark
02/15/2021, 2:20 PMMark
07/08/2025, 5:06 AMPRAGMA query_only = ON
PRAGMA cache_size = cacheSize // about 1.5x db file size
PRAGMA temp_store = MEMORY
Mark
07/27/2025, 11:40 AMquery_only
pragma because of rare cases where a simple query would lead to a read-only exception.