Jaco van der Laan

Expertise · SQL parsing & migration

Migration isn’t a rewrite. It’s a round-trip.

Most SQL migrations are a hopeful rewrite: copy the logic to the new platform, run it, and pray the numbers match. I do it the other way around — parse the existing SQL into metadata, reason about it, and generate clean SQL (or a dbt project) back. The model in the middle is what makes the move provable instead of risky.

Parse existing SQL into a metadata model in the middle, then generate clean SQL, a dbt project, tests and lineage back — a round-trip without drift
Parse → model → generate. The model is the source of truth; the tools are how it ships.

The ideas behind it

What makes my approach different.

Reverse-engineer SQL into functional blocks — not code

I don’t capture “how the query works” line by line. I capture what it does — pivot, normalize, union, aggregate — as functional metadata blocks. That abstraction is what survives a platform change; the syntax doesn’t.

CTE-by-CTE regression testing

Comparing only the final output tells you that something differs across thousands of rows. Comparing the query step by step — each CTE before and after — tells you which transformation introduced it. Root cause found, not just symptom. Migration debugging, roughly 10× faster.

Metadata in the middle → generate any target

Once the logic lives as metadata, the new platform’s SQL is just one output. The same model can generate a dbt project, tests, lineage and documentation. Tool-agnostic by design — you’re never locked to where you landed.

AI that’s grounded in the model, not guessing

AI accelerates migration only when it has a structured foundation to work against. Parsed metadata gives the model something true to reason over, so it transforms SQL into explainable logic instead of a confident guess.

From the writing

I’ve worked this out in public.

Read the full archive →

Facing a migration you can’t afford to get wrong?

That’s exactly the kind of work I take on — prove it identical, step by step, and leave you with the model, not just the new SQL.

Start a conversation