streamQuery method
Executes a SQL query and returns results as a batched stream.
Since v4.1.0 this delegates to streamQueryBatched (cursor-based
odbc_stream_start_batched) so memory stays bounded to one fetch batch.
chunkSize is interpreted as fetchSize (rows per yielded chunk).
Example:
await for (final chunk in native.streamQuery(
connId,
'SELECT * FROM users',
)) {
// Process chunk
}
Implementation
Stream<ParsedRowBuffer> streamQuery(
int connectionId,
String sql, {
int chunkSize = 1000,
}) =>
streamQueryBatched(
connectionId,
sql,
fetchSize: chunkSize,
);