Show sqlite compile options

pull/209/head
M66B 2 years ago
parent 41e8c3b950
commit e87198c24a

@ -138,7 +138,8 @@ public abstract class DB extends RoomDatabase {
"page_count", "page_size", "max_page_count", "freelist_count",
"cache_size", "cache_spill",
"soft_heap_limit", "hard_heap_limit", "mmap_size",
"foreign_keys", "auto_vacuum"
"foreign_keys", "auto_vacuum",
"compile_options"
));
@Override
@ -468,8 +469,15 @@ public abstract class DB extends RoomDatabase {
// https://www.sqlite.org/pragma.html
for (String pragma : DB_PRAGMAS)
if (!"compile_options".equals(pragma) || BuildConfig.DEBUG)
try (Cursor cursor = db.query("PRAGMA " + pragma + ";")) {
Log.i("Get PRAGMA " + pragma + "=" + (cursor.moveToNext() ? cursor.getString(0) : "?"));
boolean has = false;
while (cursor.moveToNext()) {
has = true;
Log.i("Get PRAGMA " + pragma + "=" + (cursor.isNull(0) ? "<null>" : cursor.getString(0)));
}
if (!has)
Log.i("Get PRAGMA " + pragma + "=<?>");
}
if (BuildConfig.DEBUG && false) {

@ -5,6 +5,7 @@ include $(CLEAR_VARS)
# SQLITE_TEMP_STORE=3 causes all TEMP files to go into RAM. and thats the behavior we want
# SQLITE_ENABLE_FTS3 enables usage of FTS3 - NOT FTS1 or 2.
# SQLITE_DEFAULT_AUTOVACUUM=1 causes the databases to be subject to auto-vacuum
# https://www.sqlite.org/psow.html
sqlite_flags := \
-DNDEBUG=1 \
-DHAVE_USLEEP=1 \
@ -25,7 +26,6 @@ sqlite_flags := \
-DSQLITE_ENABLE_JSON1 \
-DSQLITE_ENABLE_RTREE=1 \
-DSQLITE_UNTESTABLE \
-DSQLITE_OMIT_COMPILEOPTION_DIAGS \
-DSQLITE_DEFAULT_FILE_PERMISSIONS=0600 \
-DSQLITE_DEFAULT_MEMSTATUS=0 \
-DSQLITE_MAX_EXPR_DEPTH=0 \

Loading…
Cancel
Save