Skip to content

Commit 2379d44

Browse files
committed
update readme
1 parent dd2d3b1 commit 2379d44

File tree

1 file changed

+28
-8
lines changed

1 file changed

+28
-8
lines changed

readme.md

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,33 @@
1515

1616
---
1717

18-
`sqloxide` wraps rust bindings for [sqlparser-rs](https://github.com/ballista-compute/sqlparser-rs) into a python package using `pyO3`.
18+
`sqloxide` wraps rust bindings for [sqlparser-rs](https://github.com/sqlparser-rs/sqlparser-rs) into a python package using [PyO3](https://pyo3.rs).
1919

2020
The original goal of this project was to have a very fast, efficient, and accurate SQL parser I could use for building data lineage graphs across large code bases (think hundreds of auto-generated .sql files). Most existing sql parsing approaches for python are either very slow or not accurate (especially in regards to deeply nested queries, sub-selects and/or table aliases). Looking to the rust community for support, I found the excellent `sqlparser-rs` crate which is quite easy to wrap in python code.
2121

22-
## Installation
22+
## Free-threaded Python Support
23+
24+
As of v0.61.0, `sqloxide` ships wheels for free-threaded Python (3.13t, 3.14t). This means you can parse SQL from multiple threads in parallel with the GIL disabled, no locks needed:
25+
26+
```python
27+
import concurrent.futures
28+
from sqloxide import parse_sql
29+
30+
queries = [f"SELECT col_{i} FROM table_{i}" for i in range(100)]
31+
32+
with concurrent.futures.ThreadPoolExecutor(max_workers=8) as pool:
33+
results = list(pool.map(lambda q: parse_sql(sql=q, dialect="generic"), queries))
34+
```
2335

24-
The project provides `manylinux2014` wheels on pypi so it should be compatible with most linux distributions. Native wheels are also now available for OSX and Windows.
36+
Install a free-threaded Python with [uv](https://docs.astral.sh/uv/):
2537

26-
To install from pypi:
38+
```sh
39+
uv python install 3.13t
40+
```
41+
42+
## Installation
43+
44+
Wheels are available on PyPI for Linux (x86_64, i686, aarch64), macOS (x86_64, ARM), and Windows, covering Python 3.9 through 3.14 (including free-threaded 3.13t and 3.14t).
2745

2846
```sh
2947
pip install sqloxide
@@ -170,7 +188,7 @@ We run 4 benchmarks, comparing to some python native sql parsing libraries:
170188
To run them on your machine:
171189

172190
```
173-
poetry run pytest tests/benchmark.py
191+
just benchmark
174192
```
175193

176194
```
@@ -189,11 +207,13 @@ test_mozsqlparser 2,793.8400 (94.13) 12,358.7790 (245.07) 3,091.8519 (1
189207
The `depgraph` example reads a bunch of `.sql` files from disk using glob, and builds a dependency graph of all of the objects using graphviz.
190208

191209
```
192-
poetry run python ./examples/depgraph.py --path {path/to/folder/with/queries}
210+
uv run python ./examples/depgraph.py --path {path/to/folder/with/queries}
193211
```
194212

195213
## Develop
196214

197-
1) Install `rustup`
215+
1) Install [rustup](https://rustup.rs/) and [uv](https://docs.astral.sh/uv/)
216+
217+
2) `just dev` will sync dependencies, compile the native extension, and install it into the venv.
198218

199-
2) `poetry install` will automatically create the venv, compile the package and install it into the venv via the build script.
219+
3) `just test` to run the test suite, `just check` to run the type checker.

0 commit comments

Comments
 (0)