executePrepared method

Future<Uint8List?> executePrepared(
  1. int stmtId,
  2. List<ParamValue>? params,
  3. int timeoutOverrideMs,
  4. int fetchSize, {
  5. int? maxBufferBytes,
})

Executes a prepared statement stmtId in the worker with optional params. Returns the binary result, or null on error.

Implementation

Future<Uint8List?> executePrepared(
  int stmtId,
  List<ParamValue>? params,
  int timeoutOverrideMs,
  int fetchSize, {
  int? maxBufferBytes,
}) async {
  final bytes =
      params == null || params.isEmpty ? null : serializeParams(params);
  final r = await _sendRequest<QueryResponse>(
    ExecutePreparedRequest(
      _nextRequestId(),
      stmtId,
      bytes ?? Uint8List(0),
      timeoutOverrideMs: timeoutOverrideMs,
      fetchSize: fetchSize,
      maxResultBufferBytes: maxBufferBytes,
    ),
  );
  if (r.error != null) return null;
  return r.data;
}