mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-29 19:25:34 +00:00
Debug: query logging
This commit is contained in:
parent
f2fb73b926
commit
3420c8aa58
1 changed files with 11 additions and 1 deletions
|
@ -405,7 +405,7 @@ public abstract class DB extends RoomDatabase {
|
||||||
ExecutorService executorQuery = Helper.getBackgroundExecutor(threads, "query");
|
ExecutorService executorQuery = Helper.getBackgroundExecutor(threads, "query");
|
||||||
ExecutorService executorTransaction = Helper.getBackgroundExecutor(0, "transaction");
|
ExecutorService executorTransaction = Helper.getBackgroundExecutor(0, "transaction");
|
||||||
|
|
||||||
return Room
|
RoomDatabase.Builder<DB> builder = Room
|
||||||
.databaseBuilder(context, DB.class, DB_NAME)
|
.databaseBuilder(context, DB.class, DB_NAME)
|
||||||
//.openHelperFactory(new RequerySQLiteOpenHelperFactory())
|
//.openHelperFactory(new RequerySQLiteOpenHelperFactory())
|
||||||
.setQueryExecutor(executorQuery)
|
.setQueryExecutor(executorQuery)
|
||||||
|
@ -479,6 +479,16 @@ public abstract class DB extends RoomDatabase {
|
||||||
createTriggers(db);
|
createTriggers(db);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (BuildConfig.DEBUG && false)
|
||||||
|
builder.setQueryCallback(new QueryCallback() {
|
||||||
|
@Override
|
||||||
|
public void onQuery(@NonNull String sqlQuery, @NonNull List<Object> bindArgs) {
|
||||||
|
Log.i("query=" + sqlQuery);
|
||||||
|
}
|
||||||
|
}, executorQuery);
|
||||||
|
|
||||||
|
return builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Integer getCacheSizeKb(Context context) {
|
static Integer getCacheSizeKb(Context context) {
|
||||||
|
|
Loading…
Reference in a new issue