Skip to content

refactor: extract shared migration primitives - #60

Merged
flyxl merged 2 commits into
mainfrom
refactor/migration-shared-primitives
Oct 10, 2026
Merged

flyxl merged 2 commits into
mainfrom
refactor/migration-shared-primitives

Conversation

@flyxl

@flyxl flyxl commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

Data Transfer depended on the Data Sync domain crate to use recordset bounds, endpoint pairing and SQL name helpers. This change gives those shared implementations explicit owners so the migration engines can be reused independently by desktop and server hosts.

  • Add datazen-migration-common for typed recordset-bound conversion/comparison and category/family pairing. Data Sync and Data Transfer depend on this package; remove Data Transfer's dependency on Data Sync.
  • Move SQL identifier quoting and legacy relation qualification into driver-api::sql_identifiers. Preserve Data Sync's public utility paths through re-exports and update Transfer and desktop adapter imports.
  • Register the new package in workspace/CI discovery, add F-08 dependency protection and regression tests, and document the implemented boundaries. Each engine retains its domain rules and JobHandler implementation.

Existing pairing, SQL rendering and error behavior are preserved. The family-based qualification helper remains a compatibility utility; driver-owned SQL rewriting continues through DatabaseDriver::qualified_sql.

Test plan

  • cargo fmt --all -- --check — passed after correcting import ordering and the redundant pairing re-export alias.

  • Rust library suites: cargo test --offline --lib -p datazen-migration-common -p datazen-driver-api -p datazen-data-sync -p datazen-data-transfer -p datazen-schema-diff — 970 passed.

  • cargo test --offline -p datazen-data-sync --tests — 179 library tests and 22 integration tests passed.

  • Boundary guard and crate-discovery Vitest suites — 79 passed across 2 files.

  • Full typecheck steps executed directly: restore-block guard, tsc --noEmit, scripts typecheck and pack-EP typecheck — passed.

  • cargo check --offline -p datazen --lib — passed.

  • Real Cargo dependency boundary check, driver protocol compatibility check and platform-crate discovery dry run — passed; the new package is selected by CI discovery.

  • git diff --check — passed. HEAD and workspace fingerprints matched before/after verification.

Checklist

  • Followed CONTRIBUTING.md and repository architecture boundaries.
  • No secrets, credentials or generated files in the diff.
  • Architecture documentation updated to describe the new shared-code ownership.
  • External contracts reviewed: internal refactor with additive SQL utilities and preserved public re-exports; IPC/MCP shapes, persisted keys, driver traits and protocol versions remain unchanged.

@flyxl
flyxl merged commit bab7c67 into main Oct 10, 2026
3 checks passed
@flyxl
flyxl deleted the refactor/migration-shared-primitives branch October 10, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant