queryRows method
Future<List<Map<String, Object?> > >
queryRows(
- String sql, {
- Object parameters = const <String, Object?>{},
- MssqlQueryOptions options = MssqlQueryOptions.defaults,
- Duration? timeout,
- MssqlCancellationToken? cancellationToken,
- int? batchRows,
- int? maximumRows,
- int? maximumBytes,
- MssqlRetryPolicy? retry,
inherited
The first result set as maps.
Retry is disabled by default because returning rows does not prove that a
statement is read-only. See MssqlRetryPolicy.
Implementation
Future<List<Map<String, Object?>>> queryRows(
String sql, {
Object parameters = const <String, Object?>{},
MssqlQueryOptions options = MssqlQueryOptions.defaults,
Duration? timeout,
MssqlCancellationToken? cancellationToken,
int? batchRows,
int? maximumRows,
int? maximumBytes,
MssqlRetryPolicy? retry,
}) async {
final result = await query(
sql,
parameters: parameters,
options: options,
timeout: timeout,
cancellationToken: cancellationToken,
batchRows: batchRows,
maximumRows: maximumRows,
maximumBytes: maximumBytes,
retry: retry,
);
return result.resultSets.isEmpty
? const <Map<String, Object?>>[]
: result.resultSets.first.rows;
}