Skip to content

audit: import (csv/sql) #362

Closed
Closed

Description

@EVWorth

Drives docs/audits/import.md

Critical (P0/P1)

Backlog (P2/P3)

  • F6 [P2] [ux] CSV column-type inference silently picks TEXT for everything; no UI to specify types
  • F7 [P2] [bug] CSV import treats whitespace-only cells as strings not NULL; violates FR-8.4
  • F8 [P3] [test] No CSV-import roundtrip test

Good

  • RFC 4180 CSV parser with doubled-quote escapes; DELIMITER-aware SQL splitter; column-mapping UI before insert; preview rows before commit; per-statement error rollup; stopOnError toggle; insertBatchSize knob for max_allowed_packet

Activity

  1. added
    audit
    area/import
    on Jul 31, 2026
  2. EVWorth commented on Sep 12, 2026

    @EVWorth
    OwnerAuthor

    Import is clear.

    The P0/P1s

    #363 ARCHITECTURE declares import_data/preview_import/export_data closed earlier — the doc now describes the general commands that exist
    #364 CSV import interpolates rather than binding closed earlier: the escaping is the shared sql-quote one, with its own tests. Worth noting what the same class of bug turned out to be elsewhere — the backup generator's \\' was a reproduced injection (#650)
    #365 one failed statement aborts the rest closed earlier; stopping is now the default and the dialog says how much had already applied
    #366 no file-size cap closed earlier — and #654 goes further: a SQL file is no longer read into the renderer at all
    #367 preview does not warn about destructive statements done, with the typed-confirmation half rejected — see the issue
    #578 empty cells all became NULL done: the parser keeps whether a field was quoted, so ,, is NULL and ,"", is ''

    What changed since the audit was written

    SQL import and restore were the same operation with two implementations. #654 merged them: a SQL file now goes through restore_database, which reads it in chunks, splits it in Rust and runs it on one connection. The renderer reads the first 512 KB, for the preview and the destructive-statement list, and says when the scan did not reach the end rather than reporting "3 statements" for a two-gigabyte dump.

    The backlog

    • F8, no CSV round-trip test — done in test(import): a CSV all the way to the statements that load it #655: twelve cases from a CSV file through to the statements that load it, including the absent-versus-empty distinction the two halves used to lose between them. The SQL was run against MySQL 8.0.46 and the rows read back are what the test asserts.
    • F6, "column-type inference silently picks TEXT for everything" — does not apply. The CSV import maps onto an existing table's columns; nothing is inferred, and there is no CREATE TABLE path to infer for.
    • F7, "whitespace-only cells are strings not NULL; violates FR-8.4" — FR-8.4 does not exist in DESIGN_REQUIREMENTS, and the behaviour is right as it stands: a cell containing a space is a cell containing a space. Trimming it to NULL would be the same class of silent decision as the empty-cell one [P1][bug] CSV import turns every empty cell into NULL, which is a choice the file cannot express #578 was about.

    Nothing from this audit is outstanding.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/importaudit

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions