Translate a Snowflake SQL query so it runs on BigQuery without rewriting it by hand
Parse a SQL query to extract all table names and column references for building a data lineage tool
Reformat messy one-liner SQL into consistently indented, readable style using the pretty-print mode
Catch syntax errors like missing parentheses before running a query against a production database
| tobymao/sqlglot | khuedoan/homelab | composiohq/awesome-codex-skills | |
|---|---|---|---|
| Stars | 9,236 | 9,232 | 9,230 |
| Language | Python | Python | Python |
| Setup difficulty | easy | hard | easy |
| Complexity | 2/5 | 5/5 | 2/5 |
| Audience | data | ops devops | developer |
Figures from each repo's GitHub metadata at analysis time.
SQLGlot is a Python library that reads SQL written for one database system and converts it to work with another. Think of it like a translation service for database query language: if you wrote a query that works in Snowflake but need it to run in BigQuery or DuckDB instead, SQLGlot handles that conversion automatically. The library supports 31 different SQL dialects, covering major platforms like MySQL, PostgreSQL, DuckDB, Spark, Databricks, Snowflake, BigQuery, Hive, Presto, Trino, and more. It has no external dependencies, which means you can add it to a Python project without pulling in other packages. An optional version with compiled C extensions is also available for faster performance. Beyond translation, SQLGlot can analyze SQL queries. You can use it to find all the tables a query references, list every column used, or inspect the internal structure of a query as a tree of nodes. This is useful when building tools that need to understand what a query is doing rather than simply running it. The library can also reformat SQL into a consistent, readable style with proper indentation. SQLGlot catches certain syntax mistakes as well, pointing out things like missing closing parentheses or keywords used in the wrong context. Errors include the specific line and column where the problem appears, which makes debugging easier. The library includes a built-in query optimizer and an experimental SQL execution engine. The execution engine is mainly for testing rather than production database workloads. SQLGlot is used by data infrastructure companies and developers who need to move queries between systems, build query analysis tools, or create products that work across multiple database platforms without rewriting SQL by hand.
A Python library that translates SQL queries between 31 database dialects like Snowflake, BigQuery, and DuckDB, and can also parse, analyze, reformat, and validate SQL with no external dependencies.
Mainly Python. The stack also includes Python, pip, C extensions.
No license terms are mentioned in the explanation.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly data.
This repo across BitVibe Labs
Verify against the repo before relying on details.