Deprecated: Rust-backed SQLGlot tokenizer

0.13.0 · deprecated · verified Thu Apr 09

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

Install

Imports

Quickstart

This quickstart demonstrates basic parsing and transpilation using the core `sqlglot` library. While `sqlglotrs` provided a faster tokenizer, its functionality was exposed through `sqlglot`'s API. For current performance benefits, install `sqlglot` with the `[c]` extra.

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]"

view raw JSON →