Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
By jirikuncarv0.10.0MITIn 1 marketplace
Type-checks raw Python SQL against your schema with no ORM or database connection. A migration that makes a column nullable fails CI before production. Beta; the sqlty package needs Python 3.14+.
Trending plugins
7-day copy clicks
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
Python, SQL, PostgreSQL, SQLite, MySQL, Pydantic, VS Code, GitHub Actions
type-checking, static-analysis, schema-migrations, raw-sql, sql-linting, go, type-hints
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Your SQL already knows its types. SQLTy tells Python.
Type-safe raw SQL without an ORM or a database connection. sqlty reads row and parameter types from your SQL and schema, and checks them on every commit, so a migration that changes a column is caught in review, not in production.
A migration makes email nullable. sqlty and mypy find the code that would crash.
(view source)
Documentation: sqlty.kuncar.dev · Try it in your browser: Playground
Fits if you write raw SQL against PostgreSQL, SQLite or MySQL, with a schema dump or SQL migrations in the repository. Rows are typed end to end with psycopg 3; with other drivers sqlty checks the query and its parameters, and you annotate what the cursor returns (Drivers).
| SQL it reads | Python string literals, queries built in if/else branches (preview), .sql files (aiosql, PugSQL, sqlc), TypeScript and JavaScript templates, Go sqlty.SQL[R, P] (preview), migrations |
| Python | 3.14+ for the sqlty package; the native executable (Homebrew, npx @sqlty/cli) needs no Python and runs sqlty check on code for any Python 3; SQL[T] annotations need the package |
| Lint | over 70 rules, from select-star and unknown-column to join fan-out and migration locks; sqruff's style rules through the sqruff rule |
| Editors | VS Code extension (also on Open VSX for Cursor and VSCodium): diagnostics, quick fixes, completion, hover and SQL syntax highlighting in --sql strings; the same language server for Neovim, Vim, Helix and Emacs |
| Not read | dbt or Jinja templates, SQL assembled from arbitrary runtime strings |
Beta. APIs and configuration may change before 1.0. Feedback welcome in GitHub Issues.
Drivers return rows of Any, so nothing ties a query's columns to the code
that reads them. Start a query with --sql and a newline, and
sqlty rewrite . adds the row type inferred from your CREATE TABLE
statements:
# pyproject.toml
[tool.sqlty]
schema = "schema.sql"
schema.sql:
CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL, email VARCHAR(255) NOT NULL);
query = "--sql\nSELECT id, name, email FROM users"
# rewritten: query = SQL[tuple[int, str, str]]("--sql\nSELECT id, name, email FROM users")
SQL[T] is a str subclass, so the query still runs anywhere a string does,
and mypy, pyright and ty see T. Without a schema, casts such as id::INTEGER
type the columns; a query with neither stays as it is. With a space instead of
the newline, "--sql SELECT ..." is a SQL comment, and sqlty check warns.
[tool.sqlty]
schema = "schema.sql"
A migration dropped NOT NULL from email.
schema.sql:
CREATE TABLE users (id INTEGER PRIMARY KEY, email TEXT);
from sqlty import SQL
7-day copy clicks
Plugins from other owners that cover similar ground
npx claudepluginhub jirikuncar/sqlty --plugin sqltyBuilt from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.