queryMany method
Execute sql query with each list of positional parameters from params.
Parameters may be referenced in the sql query using $1, $2, ...
Returns a stream of rows, where each row is a list columns. If there are no data to be returned, this yields an empty stream.
The following types can be passed in and out.
Throws DatabaseException, if the query fails.
The returned Stream must prevent back-pressure from blocking the database connection to avoid deadlocks in the transaction. But if the query is executed in chunks, back-pressure may be used to block further chunks. In practice back-pressure is ignored by buffering all results in a List and return a Stream wrapping said list.
Implementation
@override
Stream<RowReader> queryMany(
String sql,
Iterable<List<Object?>> params,
) async* {
for (final p in params) {
yield* query(sql, p);
}
}