altimate-code
altimate-code copied to clipboard
refactor: split data-diff.ts (1118 lines) into focused modules
What does this PR do?
Split packages/opencode/src/altimate/native/connections/data-diff.ts into multiple files:
dialect.ts— warehouseTypeToDialect, resolveDialect, dateTruncExpr, quoteIdentForDialectcte.ts— CTE injection and query buildingpartitioning.ts— buildPartitionDiscoverySQL, buildPartitionWhereClause, runPartitionedDifforchestrator.ts— the main runDataDiff entry point
Why
Flagged during the v0.6.0 release review (Tech Lead persona). The current file is 1,118 lines with 3 as any casts and mixes dialect mapping, CTE injection, executor, orchestrator, and partitioning concerns. Violates single-responsibility; makes targeted reviews hard.
Proposed
Pure refactor — no behavior change. Move functions, preserve imports, update tests.
Deferred from
v0.6.0 release review. Filed at tag time per no-follow-up-PRs release policy.
Type of change
- [x] Refactor
Consolidated into #1680, which tracks this together with related issues. The original report here stays linked from that tracker.