executePrepared method

Future<Uint8List?> executePrepared(
  1. int stmtId,
  2. List<ParamValue>? params
)

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,
) async {
  final bytes =
      params == null || params.isEmpty ? null : serializeParams(params);
  final r = await _sendRequest<QueryResponse>(
    ExecutePreparedRequest(
      _nextRequestId(),
      stmtId,
      bytes ?? Uint8List(0),
    ),
  );
  if (r.error != null) return null;
  return r.data;
}