I am using the query
functions in order to build the SQL queries for my tables. Is there a way to see the actual query that is run? For instance log it somewher
Using an SQLiteQueryBuilder
it's painfully simple. buildQuery()
returns a raw sql string, which can then be logged:
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
qb.setTables(ExampleTable.TABLE_NAME);
String sql = qb.buildQuery(projection, selection, null, null, sortOrder, null);
Log.d("Example", sql);