Skip to content

audit: schema compare & sync #368

Closed

Description

@EVWorth

Status: filed
Drives: docs/audits/compare.md

Findings

Critical (P0/P1)

Backlog (P2/P3)

  • F8 [P2] [perf] compareSchemas runs synchronously on the main thread — large schemas freeze the UI
  • F9 [P2] [security] SyncPreview Copy Selected omits the USE line and handleExecute strips comments naively
  • F10 [P2] [ux] SchemaCompare allows same source and target database — confusing zero-change diff outcome
  • F11 [P2] [bug] sync-sql-generator routine ALTER concatenates DROP + CREATE as one sql field — destructive nature hidden
  • F12 [P3] [test] SchemaCompare.test.tsx covers MariaDB-warning but not basic object diff UI behaviour
  • F13 [P3] [convention] classifyRoutinesError regex is over-broad — matches anywhere in error string
  • F14 [P3] [arch] No unit tests for lib/schema-diff.ts or lib/sync-sql-generator.ts

Good (👍)

  • MariaDB-upgrade graceful degradation with classifyRoutinesError + dedicated banner
  • Include routines toggle checked by default (opt-out)
  • Promise.all parallelism for snapshot fetch
  • Destructive statements pre-deselected in SyncPreview
  • Confirmation dialog before Execute
  • Drop-then-add semantics for index changes
  • escapeId helper exists and is used in sync-sql-generator.ts
  • IPC chain is clean (api.* only)
  • Test coverage of failure paths (MariaDB warning, dismiss, error fallback)
  • objectType on SyncStatement distinguishes TABLE/VIEW/PROCEDURE/FUNCTION/TRIGGER

Doc drift

  • ARCHITECTURE §5.3 get_foreign_keys signature is unimplemented — F2.
  • DESIGN_REQUIREMENTS FR-8.3.2 (Data compare) is the wrong feature; schema compare has no dedicated FR.
  • TESTING_STRATEGY has no compare_tests.rs table.

Activity

  1. added
    audit
    area/compare
    on Jul 31, 2026
  2. EVWorth commented on Sep 9, 2026

    @EVWorth
    OwnerAuthor

    Closed by removing the feature.

    Schema compare could not back the claim it made — foreign keys were absent from the snapshot entirely, DDL was compared after lowercasing and collapsing whitespace, and column order was ignored — while the sync half could leave a target half-migrated. A compare tool that is quietly wrong is worse than none, because people act on its answer.

    Fixing that properly is a real piece of work, most of it a genuine DDL comparison rather than string normalisation, and the feature is not part of how this project is used. Removed rather than carried: the history has it if someone wants it back.

    Removed in the PR closing this issue: SchemaCompare, SyncPreview, schema-diff, sync-sql-generator, their tests, the compare editor tab type, and the menu, title-bar and toolbar entry points.

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/compareaudit

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions