Skip to content

Credits

sqlty builds on other people's work: the libraries it ships with, the tools that build and test it, the specifications it follows, and the projects it was compared with. This page lists them with their licenses. Projects that solve the same problem in other ways are in Prior art, and the articles that shaped the design are in Further reading.

People

Who Role
Jiri Kuncar Author and maintainer
Marcelo Trylesinski Contributor

Some changes were written with AI coding agents (Claude, GitHub Copilot). The contributor who opened each pull request reviewed it, and each commit names the agent in a Co-authored-by trailer. See AI-assisted contributions. Dependabot keeps the dependencies current.

What sqlty is built from

The wheel bundles a compiled Rust extension. The crates it is built from, and the Python packages sqlty depends on at runtime:

Project Used for License
sqlparser-rs Parsing SQL in every dialect Apache-2.0
PyO3 The Python bindings of the Rust engine MIT or Apache-2.0
regex Patterns in the source scanner and the SQL preprocessor MIT or Apache-2.0
rustc-hash Hash maps of the schema catalog MIT or Apache-2.0
stacker, recursive Stack for deeply nested expressions MIT or Apache-2.0, MIT
thiserror Error types MIT or Apache-2.0
serde, toml Reading the inference rules at build time MIT or Apache-2.0
pathspec .gitignore and exclude patterns MPL-2.0
typing_extensions Typing features before Python 3.15 PSF-2.0
psycopg The optional sqlty[psycopg] helpers LGPL-3.0

Tools

Project Used for License
maturin Building the wheels MIT or Apache-2.0
uv Environments and dependency locking MIT or Apache-2.0
Ruff Linting and formatting MIT
mypy, ty, Pyright Type checking sqlty, and checking SQL[T] with each MIT
prek Git hooks MIT
pytest, pytest-cov, pytest-randomly The test suite MIT
Hypothesis Fuzzing the analyzer and the Lean model MPL-2.0
inline-snapshot Python snapshot tests MIT
insta Rust snapshot tests Apache-2.0
Criterion.rs Engine benchmarks MIT or Apache-2.0
pytest-codspeed Benchmarks CodSpeed measures on every commit MIT
DuckDB Checking DuckDB's value types MIT
Pydantic Checking the table of Pydantic types against Pydantic MIT
PyYAML Reading hook and workflow files in tests MIT
Lean 4, elan Proofs about the type mapping Apache-2.0; elan MIT or Apache-2.0
Zensical This documentation site MIT

Ideas and specifications

  • The Markdown test format follows ty's mdtest (MIT).
  • PEPs:
  • 249: the DB-API, whose paramstyles sqlty reads.
  • 675: LiteralString.
  • 661: sentinel values, which UNTYPED is.
  • 718: subscriptable functions, an alternative to SQL[T](...).
  • 728: closed and extra_items TypedDicts, which row type checks follow.
  • 747: TypeForm, for the psycopg helpers' row types.
  • 750: template strings, which sqlty reads as queries.
  • :name placeholders are read with the rule of SQLAlchemy's text() (MIT).
  • The code of conduct is the Contributor Covenant (CC BY-SA 4.0).

Reference documentation

Every inference rule cites the documentation it follows, fetched and checked:

Compared with

The type mapping was checked against what these projects return or declare. None of them is bundled: the comparisons in scripts/compat/ install each one in a separate environment.

Project Compared License
psycopg, psycopg2 PostgreSQL values, the reference driver LGPL-3.0, LGPL with exceptions
asyncpg PostgreSQL values Apache-2.0
PyMySQL MySQL values, the reference driver MIT
mysqlclient MySQL values GPL-2.0-or-later
sqlite3, aiosqlite SQLite values PSF-2.0, MIT
sqlglot Its type annotation test fixtures MIT
SQLAlchemy Column and expression types MIT
Django Field and expression types BSD-3-Clause
Tortoise ORM Field types Apache-2.0
SQLModel Field types MIT
Piccolo Column types MIT
ormar Field types MIT
peewee Field types MIT
Pony ORM Attribute types Apache-2.0
SQLObject Column types LGPL
Synapse Running sqlty on a large project's schema and queries AGPL-3.0

Formal verification

The Lean model was chosen after reviewing these approaches: