altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

refactor: split data-diff.ts (1118 lines) into focused modules

Open anandgupta42 opened this issue 7 months ago • 1 comments

What does this PR do?

Split packages/opencode/src/altimate/native/connections/data-diff.ts into multiple files:

  • dialect.ts — warehouseTypeToDialect, resolveDialect, dateTruncExpr, quoteIdentForDialect
  • cte.ts — CTE injection and query building
  • partitioning.ts — buildPartitionDiscoverySQL, buildPartitionWhereClause, runPartitionedDiff
  • orchestrator.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

anandgupta42 avatar Apr 21 '26 20:04 anandgupta42

Consolidated into #1680, which tracks this together with related issues. The original report here stays linked from that tracker.

anandgupta42 avatar Nov 05 '26 21:11 anandgupta42