Skip to content

[P1][bug] SQL import runs serially; one failed statement aborts rest when stopOnError=true #365

Closed

Description

@EVWorth

Context

SQL import path. Per docs/audits/import.md F3.

Problem

src/components/import/ImportDialog.tsx:240-275 reads file -> splitSqlStatements -> runs each via api.executeQuery. Same transactional gap as backup F3.

Files

  • src/components/import/ImportDialog.tsx:240-275

Repro

  1. Create test SQL file with one intentional error mid-file
  2. Import against empty DB with stopOnError=true (default)
  3. Observe first N-1 statements committed, dump aborted mid-way

Expected

Whole import wrapped in transaction. On error, full rollback.

Proposed fix

M: wrap whole import in transaction (BEGIN/COMMIT/ROLLBACK). Requires dedicated import_sql_batch Tauri command owning connection for duration (option b, matches F1).

Acceptance

SQL file with mid-file error imported with stopOnError=true results in zero statements applied (full rollback).

Needs human verify

yes

Activity

  1. added
    audit
    severity/p1
    kind/bug
    area/import
    on Jul 31, 2026
  2. added a commit that references this issue on Sep 9, 2026
    33f7313
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/importauditkind/bugseverity/p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions