query abstract method
Performs a SQL query with optional args
and returns the result as a list
of column maps.
Use "?" placeholders for parameters to avoid injection vulnerabilities:
final result = await crdt.query(
'SELECT id, name FROM users WHERE id = ?1', [1]);
print(result.isEmpty ? 'User not found' : result.first['name']);
Implementation
Future<List<Map<String, Object?>>> query(String sql, [List<Object?>? args]);