Is there a convenient way to ask a particular database object to print its query?
Every now and then, I write a DBTNG db_op() in a module, and far to often, I don't quite get the queries right.
I know that devel can output the query log, but that's all queries, which, in this type of situation, is a problem more often than not.
I want to do
$result = db_select('node', 'n')->fields('n')->execute(); dpm($result->queryWithParameters); dpm($result->finalQuery);