Deprecated: Rust-backed SQLGlot tokenizer
SQLGlotrs was an optional Rust-backed tokenizer for the SQLGlot library, designed to accelerate SQL parsing performance. Introduced to provide significant speed improvements, it has since been deprecated. Users seeking performance enhancements should now use `sqlglot[c]`, which provides similar benefits through C extensions compiled with MyPyC.
Warnings
- breaking The `sqlglotrs` package is deprecated and is no longer compatible with recent versions of `sqlglot`. Attempting to use `sqlglotrs` with modern `sqlglot` installations may lead to runtime errors or unexpected behavior.
- deprecated The `sqlglotrs` library is officially deprecated. Its PyPI summary explicitly states: 'Deprecated: use sqlglotc instead.'
- gotcha Users often confuse `sqlglot`, `sqlglotrs`, and `sqlglotc`. `sqlglot` is the main Python SQL parsing library. `sqlglotrs` was an optional Rust-backed tokenizer for `sqlglot`, now replaced by `sqlglotc`, which provides C extensions for performance. Direct imports of `sqlglotrs` were generally not the intended usage.
Install
-
pip install sqlglotrs -
pip install "sqlglot[c]"
Imports
- parse_one
from sqlglot import parse_one
Quickstart
from sqlglot import parse_one, exp # Example using the core sqlglot library functionality sql_query = "SELECT a, b FROM my_table WHERE a > 10" expression_tree = parse_one(sql_query) print(expression_tree.sql(dialect="mysql")) # To get the performance benefits previously offered by sqlglotrs (now sqlglot[c]), # ensure sqlglot is installed with the '[c]' extra: pip install "sqlglot[c]"