executeQueryParams method

Future<Uint8List?> executeQueryParams(
  1. int connectionId,
  2. String sql,
  3. List<ParamValue> params, {
  4. int? maxBufferBytes,
})

Executes sql on connectionId with params in the worker.

When maxBufferBytes is set, caps the result buffer size. Returns the binary result (same format as sync API), or null on error.

Implementation

Future<Uint8List?> executeQueryParams(
  int connectionId,
  String sql,
  List<ParamValue> params, {
  int? maxBufferBytes,
}) async {
  final bytes = params.isEmpty ? Uint8List(0) : serializeParams(params);
  final r = await _sendRequest<QueryResponse>(
    ExecuteQueryParamsRequest(
      _nextRequestId(),
      connectionId,
      sql,
      bytes,
      maxResultBufferBytes: maxBufferBytes,
    ),
  );
  if (r.error != null) return null;
  return r.data;
}