added getLastSql for db widget