AltimateAI / AltimateAI/altimate-code

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

Open
#732 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
811
Forks
134
Avg merge
3d 2h
Merged PRs (30d)
50

Description

## 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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.