- debug("opQrunner", "Got "+item.sql);
- SQLiteDatabase db = App.getDatabase();
- debug("opQrunner", "Executing "+item.sql);
- db.execSQL(item.sql, item.params);
+ debug("opQRunner", "Got " + item.sql);
+ {
+ SQLiteDatabase db = App.getDatabase();
+ if (BuildConfig.DEBUG) {
+ StringBuilder b = new StringBuilder("Executing ");
+ b.append(item.sql);
+ if (item.params.length > 0) {
+ boolean first = true;
+ b.append(" [");
+ for (Object p : item.params) {
+ if (first)
+ first = false;
+ else
+ b.append(", ");
+ b.append(p.toString());
+ }
+ b.append("]");
+ }
+ debug("opQRunner", b.toString());
+ }
+ db.execSQL(item.sql, item.params);
+ }
+ if (item.onReady != null)
+ item.onReady.run();