Files
SQLWorkbench/docs/PHASE7-NOTES.md
T
Mark Gregory 5948387b4e The second file contains a SHA-256 checksum of the SQL backup.
This allows the application to detect whether the backup file has changed or become corrupted.

2. Verify Backup button

The Import/Export window now includes Verify Backup….

Select an exported SQL file, and the application calculates its checksum and compares it with the accompanying checksum file.

3. Automatic verification before import

When importing an SQL file, WorkbenchReplacement checks for an accompanying .sha256 file.

If one exists, its checksum must match before SQL execution begins.

Third-party SQL files without checksum files can still be imported.

4. Large-file handling

Checksum calculation reads files in 1 MB blocks rather than loading the entire file into memory.

This reduces memory usage when verifying large backups.
2026-10-16 22:00:32 +01:00

915 B

Phase 7 — Safer table data exports

  • Requires a non-null unique index (prefers PRIMARY) for each table being exported with data.
  • Adds explicit ORDER BY to every 250-row data page, preventing arbitrary server ordering.
  • Checks row count before and after export, and compares it to rows written. On mismatch, aborts and deletes the temporary SQL file.
  • Keeps Phase 6 SHA-256 sidecar verification and all existing UI features.

Limitations

This is not a consistent snapshot. Concurrent updates can still change row contents without changing counts, and inserts/deletes can cancel each other out. OFFSET pagination is still used; a future phase must introduce a dedicated, isolated snapshot connection and keyset paging. Tables lacking a non-null unique index cannot be data-exported in this version. No Xcode or live server test was performed. Do not rely on these exports as sole production backups.