streamQuery method

Stream<ParsedRowBuffer> streamQuery(
  1. int connectionId,
  2. String sql, {
  3. int chunkSize = 1000,
  4. int? maxBufferBytes,
})

Runs sql in the worker and yields one ParsedRowBuffer.

Same as streamQueryBatched with default chunking; full result is fetched then parsed. chunkSize is a hint. When maxBufferBytes is set, caps the result buffer size.

Implementation

Stream<ParsedRowBuffer> streamQuery(
  int connectionId,
  String sql, {
  int chunkSize = 1000,
  int? maxBufferBytes,
}) async* {
  final data = await executeQueryParams(
    connectionId,
    sql,
    [],
    maxBufferBytes: maxBufferBytes,
  );
  if (data == null || data.isEmpty) return;
  yield BinaryProtocolParser.parse(data);
}