Skip to main content
With the plugin’s arrow Cargo feature enabled, query_arrow returns a read query’s result as Arrow IPC stream bytes — a compact, columnar, zero-JSON-parse transfer that decodes directly into an Arrow table in the webview.
query_arrow requires the arrow feature. Without it the command returns backend error: the \arrow` feature is not enabled`.

Enable the feature

The feature pulls in arrow-rs and better-duck-core/arrow, and compiles the query_arrow command in.

queryArrow

  • Signature: queryArrow(query: string, values?: unknown[]): Promise<ArrayBuffer>.
  • values bind positionally, like select.
  • Resolves to an ArrayBuffer of Arrow IPC stream bytes; decode with apache-arrow’s tableFromIPC.

How it works

Server-side the backend runs the query through better-duck-core’s Arrow C Data Interface export, then serializes each exported record batch with arrow-rs’s StreamWriter. The command returns the raw bytes via tauri::ipc::Response, so the webview receives the response body directly as an ArrayBuffer rather than a JSON-encoded array.
Prefer queryArrow over select when the result is wide or numeric and the frontend already uses Arrow (or feeds a charting / dataframe library). It avoids the DuckDB → JSON → JS round-trip and preserves exact numeric types that JSON would stringify.

Policy and permissions

  • query_arrow is a read; it passes through the deny_risky_statements leading-keyword filter.
  • Permission: better-duck-tauri:allow-query-arrow (not in the default set).
Like select, query_arrow forwards arbitrary read SQL, which in DuckDB can reach the filesystem through table functions. Treat it as filesystem-read-capable and constrain it the same way (read-only, connection allow-list).

See also

  • Streaming — chunked JSON delivery for progressive rendering.
  • Arrow & Polars — the core driver’s Arrow export this builds on.
  • Feature flags — the arrow feature across the workspace.