SQLMesh SQL and Python transformation framework with change plans, reusable model environments and stateful incremental processing.
Overview SQLMesh is a data-transformation framework for SQL and Python models. It uses plans to review changes and manages model versions across development and production environments, with state tracking for previously processed data and an adapter for supported dbt projects.[1] [2] [6]
Contents Plans and backfills A plan reviews changes before they are applied. Categorizing a modification as breaking causes the affected model and downstream dependencies to be backfilled; non-breaking changes backfill the directly modified model without automatically rebuilding its dependents. Forward-only changes reuse the production physical table without historical backfill. These choices affect both historical consistency and execution cost, rather than merely changing a deployment label.[2]
Development and production Environments collect references to model snapshots. Fingerprints include a model's definition and its upstream dependencies, allowing an existing physical variant to be reused when it matches. Development can operate on a chosen date range instead of rebuilding all history. The name prod is special, and an unqualified plan targets production by default, so environment selection is operationally significant.[3]
State storage SQLMesh's state records previous model versions, environments and processed intervals. The documentation describes its workload as transactional and recommends an OLTP database or managed state service for production. An analytics warehouse may suffice for a proof of concept but is not the recommended production state store. State can be exported and imported as JSON, making state management a separate concern from retaining model source files.[4]
Scheduling lifecycle The built-in scheduler evaluates missing model intervals when run. It then exits rather than staying alive as a continuous scheduling service. Recurring operation therefore requires periodic invocation through an external scheduler or an appropriate managed arrangement. This distinction matters when replacing an existing job service: installing the framework alone does not create a continuously running production schedule.[5]
dbt project migration The dbt adapter can retain dbt file and project formats, but the documented incremental approach requires adjustments. SQLMesh distinguishes unit tests of query logic from audits of produced data, which correspond to dbt data tests. The integration also lists unsupported Jinja methods, including selected_sources and certain graph-value accessors. Those limitations should be checked against a real project rather than assuming every dbt extension transfers unchanged.[6]
Licensing and substitution SQLMesh is Apache-2.0 licensed and can substitute for dbt for supported transformation projects when the team adopts its state and plan workflow. Its documented adapter is useful evidence of migration support, but does not establish parity with every current dbt generation or hosted feature. Warehouse execution and production state infrastructure still need provision, and no hands-on conversion is claimed here.[1] [4] [6]
Also included: 3 capabilities and 0 substitute relationships. Check substitutes in section 1 and capabilities in section 3.