executeAsync method

Future<Uint8List?> executeAsync(
  1. int connectionId,
  2. String sql, {
  3. Duration pollInterval = const Duration(milliseconds: 10),
  4. Duration? timeout,
  5. int? maxBufferBytes,
})

Executes sql in non-blocking mode using native async request lifecycle.

Flow: start -> poll -> get_result -> free. Returns the binary result when execution completes successfully, or null on failure/cancellation/timeout.

Implementation

Future<Uint8List?> executeAsync(
  int connectionId,
  String sql, {
  Duration pollInterval = const Duration(milliseconds: 10),
  Duration? timeout,
  int? maxBufferBytes,
}) async {
  final requestId = await executeAsyncStart(connectionId, sql);
  if (requestId <= 0) {
    return null;
  }
  return _waitForAsyncResult(
    requestId,
    pollInterval: pollInterval,
    timeout: timeout,
    maxBufferBytes: maxBufferBytes,
  );
}