Skip to main content

SQLBabel
by SQLStack

Evidence-backed SQL translation.

Translate Snowflake, Databricks, BigQuery and Postgres SQL to DuckDB. Every rule is proven against real warehouse results. When SQLBabel won't translate, it tells you exactly why.
Website · Docs · Playground · Quickstart

SQLBabel checks SQL and converts queries to DuckDB SQL

Why SQLBabel?

SQL that runs on two engines doesn't always return the same answer. NULLs, decimal arithmetic and casts can behave differently.

SQLBabel checks its conversion rules against real results from the source warehouse. It handles those differences deliberately and gives you precise diagnostics when it can't convert a query - not plausible-looking SQL and crossed fingers.

SQLBabel's original Snowflake tokenizer, parser and syntax tree started as a modified fork of Polyglot, a Rust SQL transpiler inspired by SQLGlot. The other dialects' parsers, the translation to DuckDB, the typing and the recorded evidence behind them are SQLBabel's own.

  • Proven rules. Every conversion rule is checked against real results recorded on the warehouse.
  • A precise no. When a query won't translate, you get a code, the exact span and the reason.
  • Check early. Catch invalid SQL before it reaches the warehouse.
  • See what's blocking you. Scan a SQL project to find what converts and what needs attention.
  • Choose what to accept. Allow or refuse each known difference in sqlbabel.toml.
  • Test locally. Run converted queries on DuckDB against small fixtures, in tests and CI.

Get started

pip install sqlbabel

# Convert your first query
echo "SELECT 1 AS total" | sqlbabel convert --no-config

# Check a SQL file
sqlbabel check query.sql

# Convert a query using the tables in sources/*.yml
sqlbabel convert query.sql

Or try the playground - no installation needed.

See the supported dialects and coverage, project guide and defaults for known differences for the details.

Use it from Python

import sqlbabel

result = sqlbabel.convert(
    sql="SELECT 1 AS total",
    options=sqlbabel.ConvertOptions(no_config=True),
)

Python API

Running the suites

SQLBabel's parsers and conversion rules are checked against evidence recorded on the real engines. Rerunning it needs no account:

git clone https://github.com/sqlstack-io/sqlbabel && cd sqlbabel
uv sync
make check-syntax DIALECT=snowflake    # rerun the parser against recorded syntax evidence
make check-convert DIALECT=snowflake   # replay recorded translations on DuckDB
Command What it does
make pending DIALECT=snowflake What isn't recorded yet, in both suites
make check-syntax DIALECT=snowflake Rerun the parser against recorded evidence (offline)
make record-syntax DIALECT=duckdb Record evidence for new syntax cases
make check-convert DIALECT=snowflake [CASES=temporal] Replay recorded translations on DuckDB (offline)
make record-convert DIALECT=snowflake Record new translation cases on Snowflake
make verify-changed Replay only the cases whose conversion or recording changed since its last run
make check-merge The static checks and the Rust tests every change must pass
make test-crate CRATE=sqlbabel-evidence One crate's tests
make python-api Build the Python module and run its API tests

A pull request runs what its changed files need. Documentation and website changes build and check the site. Other changes run make check-merge, the Python tests and the replay. The replay reuses main's judgement for every case whose conversion and recording are unchanged, and replays only the rest. A change under one of the full-replay paths in scripts/replay_scope/constants.py replays every case: the DuckDB pin, the lock files, the replay, comparison and policy crates, the error kinds, CI's toolchain and the evidence pin. A change outside every crate the sqlbabel binary is built from replays nothing.

Recording needs the dialect's engine: DuckDB and SQLite record locally, while Snowflake, BigQuery and Databricks need a connection. Recording Snowflake syntax evidence isn't public yet. make help lists every target.

Credits

SQLBabel wouldn't exist without two projects:

  • Polyglot by Tobias (@tobilg). SQLBabel's original Snowflake tokenizer, parser and syntax tree started as a modified fork of Polyglot's, and much of that code is still his. The other dialects' parsers are SQLBabel's own. Tobias also fixed many issues I reported while building SQLBuild on Polyglot.
  • SQLGlot by Toby Mao and contributors, for years of work on SQL transpilation that this space builds on.

Both are MIT licensed. Their licence texts are in THIRD_PARTY_NOTICES and ship with every release.

SQLBabel goes a different way from both on translation. It doesn't rewrite the tree and print it out. It checks each rule against recorded warehouse results and refuses what it can't prove.


Built in Rust. Free and open source. Apache 2.0.

Questions and feedback are welcome on Discord.

Part of SQLStack.

Metadata

Release files for sqlbabel-cli 0.39.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sqlbabel-cli 0.39.0
File Size Uploaded Provenance Actions
sqlbabel_cli-0.39.0.tar.gz 3.5 MB With provenance Details for sqlbabel_cli-0.39.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for sqlbabel-cli 0.39.0
File Actions
sqlbabel_cli-0.39.0-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for sqlbabel_cli-0.39.0-py3-none-win_amd64.whl
sqlbabel_cli-0.39.0-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for sqlbabel_cli-0.39.0-py3-none-manylinux_2_28_x86_64.whl
sqlbabel_cli-0.39.0-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for sqlbabel_cli-0.39.0-py3-none-manylinux_2_28_aarch64.whl
sqlbabel_cli-0.39.0-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for sqlbabel_cli-0.39.0-py3-none-macosx_11_0_arm64.whl
sqlbabel_cli-0.39.0-py3-none-macosx_10_15_x86_64.whl Python 3 none macOS 10.15+ x86-64 Details for sqlbabel_cli-0.39.0-py3-none-macosx_10_15_x86_64.whl

Total release size: 212.8 MB

Release files / sqlbabel_cli-0.39.0.tar.gz

Download URL sqlbabel_cli-0.39.0.tar.gz
Size 3.5 MB
Tags Source
SHA-256 checksum
How to use checksums
b2de577bed9d49459b7aa9bdacdeb714d2a432055522ac86a565230860ab96cc
BLAKE2b-256 checksum
How to use checksums
e4827da209567e780d74c2a1f885b67842a2bdc214e3c65041d6539a45ac6feb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / sqlbabel_cli-0.39.0-py3-none-win_amd64.whl

Download URL sqlbabel_cli-0.39.0-py3-none-win_amd64.whl
Size 41.8 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
f4595b8febe64a2d22b9cae28d27c7c19ec13f556182d84434c195a0d770740e
BLAKE2b-256 checksum
How to use checksums
25083b3797c754e0b74738a32faba4e5c78d680dc2c2f6e1779e32e47132dc66
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / sqlbabel_cli-0.39.0-py3-none-manylinux_2_28_x86_64.whl

Download URL sqlbabel_cli-0.39.0-py3-none-manylinux_2_28_x86_64.whl
Size 46.0 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
c7fe0f32e908af9c625cacc8069459689a40c05c95106be246ab80aca69951db
BLAKE2b-256 checksum
How to use checksums
0ce5ccb043218d37f5e2ea1843738f469f387510529cd9aa4fc849d97337265e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / sqlbabel_cli-0.39.0-py3-none-manylinux_2_28_aarch64.whl

Download URL sqlbabel_cli-0.39.0-py3-none-manylinux_2_28_aarch64.whl
Size 40.9 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
9323c469cb5278d9e769ad5e950925a6c09e1984145c8e3c3b2c20ba0e12d068
BLAKE2b-256 checksum
How to use checksums
c7af5c12adfe5806906e1f5aa12278d15b8e510a48c535bf647ccd761efad650
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / sqlbabel_cli-0.39.0-py3-none-macosx_11_0_arm64.whl

Download URL sqlbabel_cli-0.39.0-py3-none-macosx_11_0_arm64.whl
Size 38.7 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
caf1f9adc55f161bd2856c6d280eb2aba74c7f14d831cfa917992ff12de0e185
BLAKE2b-256 checksum
How to use checksums
95aed6960bf09c4da9105abe96c03940ee410994fdd0bd0f46661396b14a57ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Release files / sqlbabel_cli-0.39.0-py3-none-macosx_10_15_x86_64.whl

Download URL sqlbabel_cli-0.39.0-py3-none-macosx_10_15_x86_64.whl
Size 41.8 MB
Tags Python 3 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
4fafc38233fbba117814f002189dba1f3a3729d0226075347e83d7c69b5d082f
BLAKE2b-256 checksum
How to use checksums
867df88cbb6abc384cdb7f5a19325b463767f4aa1ed023b54ecdf886d908baf3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

Security for sqlbabel-cli 0.39.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for sqlbabel_cli-0.39.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page