skillfed

sqlglotc

mypyc-compiled extensions for sqlglot

sqlglotc v30.17.0 2.1M downloads/30d#3,281 on PyPI9,529
Permissive license MIT Active released

What it is and what it does

sqlglotc bundles mypyc-optimized C extensions to accelerate SQL parsing and manipulation through sqlglot. It wraps sqlglot and trades pure-Python portability for speed, delivering roughly 3-5x faster execution on parsing, transpilation, and analysis tasks. The package is designed as a drop-in replacement: install it instead of the base package, and operations run faster without code changes.

The underlying sqlglot library handles SQL parsing across over 30 dialects (DuckDB, Presto, Spark, Snowflake, BigQuery, and others), transpilation between them, query optimization, and syntax error detection. sqlglotc simply accelerates these operations by compiling hot paths to native code. It depends on sqlglot as its runtime dependency and is most useful when parsing or transpiling large volumes of SQL or running in performance-sensitive applications.

Use it for:

  • Accelerate batch SQL transpilation pipelines that convert queries between multiple database dialects.
  • Speed up query analysis and metadata extraction (finding columns, tables, and dependencies) in large codebases.
  • Reduce latency in real-time SQL formatting or validation services that handle many requests per second.
  • Optimize data warehouse migration tools that parse and rewrite SQL at scale.
  • Improve performance of SQL linting or code-review tools that analyze many queries in sequence.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides mypyc-compiled C extensions that accelerate sqlglot's SQL parsing, transpilation, and analysis operations by roughly 3-5x compared to the pure Python version.

Yes, if you use sqlglot and performance matters. The compiled extensions are a strict speedup with no API changes—install sqlglotc and operations run 3-5x faster. The trade-off is medium install friction (compiled wheels for common platforms, but source builds elsewhere) and a requirement for Python 3.10 or later. No known vulnerabilities and actively maintained. Skip it only if you need custom dialects or are on an unsupported platform where source compilation is impractical.

Install

sqlglotc on PyPI

pip

pip install sqlglotc

uv

uv add sqlglotc

poetry

poetry add sqlglotc

Installing sqlglotc

Before you install

Medium install friction due to compiled wheels; prebuilt binaries are available for Python 3.10–3.14 on macOS, Linux (x86_64 and aarch64), and Windows, but source builds may be required on unsupported platforms. Package is actively maintained with releases every few days.

License in practice

MIT license permits commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install "sqlglotc[c]"

import sqlglot
result = sqlglot.transpile("SELECT * FROM table", read="postgres", write="duckdb")[0]

Requires Python 3.10 or later; source builds on unsupported platforms may require a C compiler and mypyc toolchain.

Verify before relying

  • Whether custom dialects work correctly with the compiled extensions (documentation notes potential incompatibility).
  • Exact performance improvement margin on real-world workloads beyond the stated 3-5x benchmark range.
  • Whether the [c] extra is available for sqlglotc or if compilation is automatic.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — sqlglot
Maintenance actively maintained — 2 days since the last release
Last repo commit
First released
Downloads 2,119,006/month — #3,281 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: sqlglotc-30.17.0-cp310-cp310-macosx_10_9_universal2.whl; sqlglotc-30.17.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; sqlglotc-30.17.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; sqlglotc-30.17.0-cp310-cp310-win_amd64.whl; sqlglotc-30.17.0-cp311-cp311-macosx_10_9_universal2.whl; sqlglotc-30.17.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; sqlglotc-30.17.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; sqlglotc-30.17.0-cp311-cp311-win_amd64.whl; sqlglotc-30.17.0-cp312-cp312-macosx_10_13_universal2.whl; sqlglotc-30.17.0-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; sqlglotc-30.17.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; sqlglotc-30.17.0-cp312-cp312-win_amd64.whl; sqlglotc-30.17.0-cp313-cp313-macosx_10_13_universal2.whl; sqlglotc-30.17.0-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; sqlglotc-30.17.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; sqlglotc-30.17.0-cp313-cp313-win_amd64.whl; sqlglotc-30.17.0-cp314-cp314-macosx_10_15_universal2.whl; sqlglotc-30.17.0-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; sqlglotc-30.17.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; sqlglotc-30.17.0-cp314-cp314-win_amd64.whl

Tags

sqlglot c extensionsfast sql parsercompiled sqlglotsql transpiler performancemypyc compiled sqlsql dialect translationoptimized sql parsing
sql-parsingperformance-optimizationcompiled-extension

More Database packages