Skip to content

export: support external plugin drivers (CSV/JSON)#366

Open
danielnuld wants to merge 1 commit into
TabularisDB:mainfrom
danielnuld:export-plugin-support
Open

export: support external plugin drivers (CSV/JSON)#366
danielnuld wants to merge 1 commit into
TabularisDB:mainfrom
danielnuld:export-plugin-support

Conversation

@danielnuld

Copy link
Copy Markdown
Contributor

Problem

export_query_to_file (the Export as CSV/JSON action in the SQL editor) only
supports the built-in drivers — stream_to_sink matches mysql/postgres/sqlite
and returns Unsupported driver for export: <id> for every external plugin driver.
So users on plugin-backed connections (e.g. the IBM Informix plugin) can't export.

Change

Adds a fallback branch for plugin drivers in src-tauri/src/export.rs: it looks
up the registered driver via registry::get_driver and pages through the driver's
own execute_query (1000 rows/page), forwarding every row to the existing
RowSink (CSV or JSON). Built-in drivers are untouched and still stream directly.

other => stream_query_via_plugin(other, params, query, &mut on_row).await,

The loop stops when a page returns no rows or pagination.has_more is false
(falling back to "fewer than a full page" when a driver doesn't report pagination),
so non-SELECT statements terminate immediately. Progress/cancellation are handled
by the existing on_row closure, so the cancel button and progress modal keep
working for plugins too.

Notes

  • No change to the public command surface or the built-in code paths.
  • I wasn't able to run a full local cargo check here — the openssl-sys
    vendored build needs perl, which isn't available in my shell (unrelated to
    this change). The patch mirrors the existing built-in dispatch and the driver
    trait signature exactly; CI should confirm the build.

@kilo-code-bot

kilo-code-bot Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (1 file)
  • src-tauri/src/export.rs

Reviewed by kimi-k2.7-code-20260612 · Input: 60.5K · Output: 9.6K · Cached: 915.5K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant