--- id: sqloxide version: "0.61.1" license: MIT license_treatment: permissive maintenance: active --- # sqloxide — Python bindings for sqlparser-rs License: permissive · Maintenance: active · Downloads: 594.0K/mo ## What it is and what it does sqloxide is a Python wrapper around the Rust sqlparser-rs library, providing fast SQL parsing without the GIL. It parses SQL into a typed AST matching the sqlparser-rs schema, and exposes APIs to reconstruct SQL from the AST or apply visitor-pattern mutations to expressions and table relations. The package was built to handle data lineage extraction across large codebases, particularly for complex queries with deep nesting, subselects, and table aliases—problems where pure-Python parsers are either slow or inaccurate. The package includes free-threaded Python support (3.13t, 3.14t), allowing parallel SQL parsing from multiple threads without locks. Benchmarks show it parses queries roughly 12× faster than sqlglot, 50× faster than sqlparse, and 100× faster than moz-sql-parser. It has no runtime dependencies and ships precompiled wheels for common platforms and Python versions. Use it for: - Extract table and column dependencies from hundreds of auto-generated SQL files to build data lineage graphs. - Rewrite SQL queries programmatically by mutating the AST (e.g., renaming tables, uppercasing identifiers). - Parse and validate SQL syntax in data pipeline tools or ETL frameworks where speed matters. - Analyze complex nested queries and subselects where Python-native parsers fail or are too slow. - Parallelize SQL parsing across multiple threads in free-threaded Python without GIL contention. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. sqloxide parses SQL queries into a typed abstract syntax tree (AST) using Rust bindings for sqlparser-rs, and can reconstruct or rewrite SQL from the AST. Yes. sqloxide is actively maintained, has no runtime dependencies, offers significant speed advantages over pure-Python alternatives, and covers modern Python versions including free-threaded support. The MIT license is permissive. Install it if you need fast, accurate SQL parsing for lineage, rewriting, or analysis; skip it only if you need extensive documentation or are locked to older Python versions. ## Install pip install sqloxide uv add sqloxide poetry add sqloxide ## Installing sqloxide Before you install: Medium install friction due to compiled wheels, but well-supported across Python 3.9–3.14 on Linux, macOS, and Windows. Active maintenance with recent releases; last commit 2026-04-09. License in practice: MIT license permits unrestricted use, modification, and distribution in proprietary and open-source projects with minimal restrictions. Quickstart: pip install sqloxide from sqloxide import parse_sql sql = "SELECT col1, col2 FROM table1 WHERE col1 = 1" ast = parse_sql(sql=sql, dialect='ansi') print(ast) Requires Python 3.9 or later; precompiled wheels available for Python 3.9–3.14 on Linux, macOS, and Windows. Verify before relying: - Whether the AST schema and mutation APIs are stable across minor versions or subject to breaking changes. - Performance characteristics on very large or deeply nested queries beyond the benchmarks shown. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 594.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags sql parser python, sql ast parsing, sql query analysis, sql syntax tree, fast sql parsing, sql rewriting, sql lineage extraction, sql-parsing, rust-bindings, ast-manipulation [View on SkillFed](https://skillfed.io/packages/sqloxide) · [View on PyPI](https://pypi.org/project/sqloxide/)