Command-line tool
tobymao / sqlglot
Python SQL Parser and Transpiler
This connects Repowise to tobymao/sqlglot's code. It does not install sqlglot.
Repowise maps public repos from their source. Not affiliated with tobymao. What is Repowise?
github.com/tobymao/sqlglotIndexed at d375836
What is sqlglot?
SQLGlot is a Python library for parsing, translating, and optimizing SQL. It reads SQL text written in one dialect and converts it into a dialect-neutral expression tree, which can be rewritten and then turned back into SQL for another dialect. SQLGlot is written purely in Python and is described as having no dependencies. To install it, run git clone https://github.com/tobymao/sqlglot.git and follow the steps below. Its code health is 4.2 out of 10 (Needs_work), ranked #248 of 4,000+ indexed repos. The last commit to sqlglot was on Oct 26, 2026, and 466 people have contributed.
As of commit d375836, indexed Oct 26, 2026. What it is comes from a model reading the README; the rest is measured from the source and git history, not from the maintainer.
For agentssqlglot.md
Repo facts: type, license, health, rank, contributors
| Type | Command-line tool |
|---|---|
| License | MIT |
| Code health | 4.2 / 10 (Needs_work) |
| Health rank | #248 of 4,000+ indexed repos |
| Last commit | Oct 26, 2026 |
| Contributors | 466 |
| Bus factor | 2 |
| Size | 275 files, 125,231 lines |
Install sqlglot
Commands copied from the README
- 1Clone the sqlglot repository.
git clone https://github.com/tobymao/sqlglot.git - 2Move into the sqlglot folder.
cd sqlglot - 3Install the pure Python version from PyPI.
pip3 install sqlglot - 4From a local checkout, install the package with make.
make install
Explore sqlglot
- DocumentationModule-by-module documentation, 690 pages.
- ArchitectureDependency graph, layers and third-party dependencies.
- Code healthEvery file's score and the findings behind it.
- CommitsEach commit's effect on code health.
- OverviewEverything else the index found: contributors, decisions, what changed this week.
Ask about this code in your agent
This connects Repowise to sqlglot's code. It does not install sqlglot. To install sqlglot, use the install steps.
Useful if you want to change or fork sqlglot: your agent can ask how it is put together and get answers that cite its files.
Ask about sqlglot
Answers come from sqlglot's README and source, with the files they cite. Two free answers a day without an account.
Want this for your own codebase? Map your repo free
About this page
Get a page like this for your own codebase
Repowise built this map of tobymao/sqlglot from its source and git history. It parses every symbol, draws the dependency graph, scores each file's health from complexity, duplication, coverage and churn, finds hotspots and owners in the history, and writes documentation for every module. Your coding agent reads the same index over MCP, so its answers cite real files.
Free for 2 public repos, with a page like this one. No card. See how Repowise works
Prefer local? pip install repowise && repowise init indexes your own checkout, no account needed. Star Repowise on GitHub
tobymao/sqlglot FAQ
What is SQLGlot?
SQLGlot is a SQL parser, transpiler, optimizer, and engine written in Python. It translates SQL between over 30 dialects, such as DuckDB, Snowflake, and BigQuery.
How does SQLGlot work?
SQLGlot parses SQL text in one dialect into a dialect-neutral expression tree. It can optimize that tree and then generate SQL text for a target dialect.
How do I install SQLGlot?
SQLGlot installs from PyPI with pip3 install sqlglot. Installing the c extra with pip3 install "sqlglot[c]" builds compiled extensions on Python 3.10 and later. See the install steps
What language is SQLGlot written in?
SQLGlot is written purely in Python. The repository holds 255 Python files and is described as having no dependencies.
How is the SQLGlot code organized?
The core library lives in the sqlglot directory, with 183 files. Tests are in the tests directory, and sqlglotc builds the optional compiled variant of the library.
Who is SQLGlot for?
SQLGlot is for data engineers and for tools built on top of it. It sits beneath query engines, orchestrators, and dataframe libraries such as SQLMesh, Apache Superset, Dagster, and Ibis.
What license does SQLGlot use?
SQLGlot uses the MIT license, identified as MIT.
Code health
Hotspots average 2.4, the place fixes pay off most.
On the leaderboards:#69 of 71 Python repos
Key features of sqlglot
- SQLGlot translates SQL between over 30 dialects, such as DuckDB, Presto / Trino, Spark / Databricks, Snowflake, and BigQuery.
- SQLGlot detects syntax errors such as unbalanced parentheses and reports them as a ParseError.
- SQLGlot lets you customize the parser, analyze queries, and traverse expression trees.
- SQLGlot can build SQL programmatically by composing expressions.
- SQLGlot preserves comments on a best-effort basis when it translates a query.
- SQLGlot can rewrite queries into an optimized canonical AST that can standardize queries.
How tobymao/sqlglot works
SQL text enters through the functions exposed at the package root in sqlglot/__init__.py, and sqlglot/__main__.py is the module entry point. The parser in sqlglot/parser.py builds the dialect-neutral expression tree from the input. An optional optimizer can rewrite that tree into a canonical form. sqlglot/generator.py then produces SQL text from the tree, and dialect modules such as sqlglot/dialects/duckdb.py supply the rules for each target dialect. The same tree is also used by the in-memory executor and the AST diff. pdoc/cli.py builds the HTML API reference.
The codebase has 275 files and 6,434 symbols in 7 modules, led by Python, Makefile and Shell. Code health is 4.1 out of 10, rated needs work.
Maintain tobymao/sqlglot?
Claim this page, add a badge to the README, or re-index it.
Claim this page
Sign in with GitHub and we check that you are an admin or maintainer of tobymao/sqlglot. Then add a badge to the README that links readers here.
Add a badge to your README
Readers click through to this page and can ask sqlglot's code a question. A badge also re-indexes the repo every week and marks you as the verified maintainer.
[](https://repowise.dev/repo/tobymao/sqlglot?src=badge_ask)Paste it at the top of README.md, under the title.
Added it already? Verify to get the mark now instead of tomorrow.
Need HTML or the larger health card? More formatsHide more formats
This badge as HTML
<a href="https://repowise.dev/repo/tobymao/sqlglot?src=badge_ask"><img src="https://api.repowise.dev/badge/wiki/tobymao/sqlglot.svg?label=ask" alt="repowise: Ask this codebase"></a>Code health card
The score, its change since the last index, and when it was measured. Follows the reader's light or dark theme.
<a href="https://repowise.dev/repo/tobymao/sqlglot?src=badge_card"><picture><source media="(prefers-color-scheme: light)" srcset="https://api.repowise.dev/badge/health/tobymao/sqlglot.svg?style=card&theme=light"><img src="https://api.repowise.dev/badge/health/tobymao/sqlglot.svg?style=card" alt="repowise code health" width="500" height="168"></picture></a>