renamed getLastSql to getLastQuery, be consistent with getQueries