queryRaw method
Execute a raw SQL query and return results
Implementation
@override
Future<SqlResultSet> queryRaw(SqlQuery query) async {
try {
// Convert args to PostgreSQL-compatible format
final convertedArgs = _convertArgs(query.args, query.argTypes);
// Execute query - don't use pg.Sql.indexed since we already have placeholders
final result = await _connection.execute(
query.sql,
parameters: convertedArgs.isEmpty ? null : convertedArgs,
);
// Convert result to SqlResultSet
return _convertResult(result);
} catch (e) {
throw AdapterError(
'Failed to execute query: ${e.toString()}',
code: _extractErrorCode(e),
originalError: e,
);
}
}