Skip to content

[Feat]: Import data from file (CSV/TSV/JSON)Β #484

Description

@pokertour

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

πŸš€ Feature Proposal

Add "Import from file…" as a data source for table imports, alongside the existing clipboard import.

The clipboard import modal is already a full-featured import pipeline: format detection (TSV / CSV / JSON array / Markdown table), type inference with confidence levels, schema editor, data preview, create/append modes with fail/append/replace strategies, mapping to existing columns and ALTER TABLE ADD COLUMN for new ones β€” all driver-agnostic on the Rust side (execute_clipboard_import goes through the driver trait, so plugins work too).

The only missing piece is the data source: today the modal can only read from the clipboard, which is not a workable flow for actual files.

Proposed v1 (small):

  • A file picker (.csv, .tsv, .json, .md) feeding the file content into the existing parse β†’ infer β†’ preview β†’ execute pipeline;
  • the modal becomes a generic "Import data" modal with two sources (clipboard / file);
  • a size guard with a warning above ~10–20 MB, since parsing happens in the frontend.

Follow-up v2 (large files):

  • Rust-side streaming CSV parsing (the csv crate is already a dependency for export) with batched inserts, progress events and cancellation β€” mirroring the existing streaming export pipeline;
  • switch inserts to prepared statements / multi-row batches for throughput;
  • fix the frontend CSV parser to support quoted cells containing newlines (it currently splits on \n before parsing β€” fine for clipboard content, not for real-world CSV files).

Motivation

Tabularis can export result sets to CSV/JSON files (and soon Markdown), but there is no way to import a file into a table β€” the asymmetry is surprising for users coming from other DB tools. Loading a CSV into a new or existing table is one of the most common day-to-day tasks.

Example

Table context menu / explorer β†’ "Import data…" β†’ pick users.csv β†’ same schema/preview screen as the clipboard import β†’ rows inserted with create-table or append.


Happy to work on a PR (v1 first) if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions