streamStartBatched method

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

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,
  int resultEncodingWire = 0,
}) {
  return _withSql<int>(
        sql,
        (sqlPtr) {
          if (resultEncodingWire != 0) {
            final optionsId = _bindings.odbc_stream_start_batched_options(
              connectionId,
              sqlPtr,
              fetchSize,
              chunkSize,
              resultEncodingWire,
            );
            if (optionsId != null) {
              return optionsId;
            }
          }
          return _bindings.odbc_stream_start_batched(
            connectionId,
            sqlPtr,
            fetchSize,
            chunkSize,
          );
        },
      ) ??
      0;
}