streamStartBatched method

int streamStartBatched(
  1. int connectionId,
  2. String sql, {
  3. int fetchSize = 1000,
  4. int chunkSize = 64 * 1024,
})

Starts a batched streaming query.

The connectionId must be a valid active connection. The sql should be a valid SQL SELECT statement. The fetchSize specifies how many rows to fetch per batch. The chunkSize specifies the buffer size in bytes.

Returns a stream ID on success, 0 on failure.

Implementation

int streamStartBatched(
  int connectionId,
  String sql, {
  int fetchSize = 1000,
  int chunkSize = 64 * 1024,
}) {
  return _withSql<int>(
        sql,
        (sqlPtr) => _bindings.odbc_stream_start_batched(
          connectionId,
          sqlPtr,
          fetchSize,
          chunkSize,
        ),
      ) ??
      0;
}