/sqlty:sqlty-serverfrom sqlty
Sets up sqlty LSP server in VS Code, Neovim, Helix, Emacs and other editors. Reports SQL diagnostics, provides quick fixes, completions, and hover info for query strings in Python files.
Ships in sqlty. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
sqlty server is a language server on standard input and output. It reports what
sqlty check reports while you type, each diagnostic under the name, row type or
query it is about, with the fix of sqlty check --fix as a quick fix. In a query
string it completes table, column and function names, and hover shows a column's type, a table's
columns or a result column's inference rule.
Run sqlty version: this skill may be newer or older than the installed sqlty.
When it and sqlty server --help disagree, trust the command.
[tool.sqlty]
schema = "schema.sql"
schema.sql:
CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT NOT NULL);
from sqlty import SQL
# error: [unknown-column] "column `nmae` does not exist in `users`"
q = SQL[tuple[int, str]]("--sql\nSELECT id, nmae FROM users")
Install sqlty (jirikuncar.sqlty) from the Visual Studio Marketplace, or from
Open VSX in Cursor, VSCodium and other builds of VS Code:
code --install-extension jirikuncar.sqlty
The extension bundles no sqlty. It runs the one your project pins, so add it to the
project's environment (uv add --dev sqlty) and the editor reports what CI reports.
| Setting | Meaning |
|---|---|
sqlty.path | sqlty executables to try first |
sqlty.interpreter | The interpreter whose sqlty runs; empty is the one the Python extension selects |
sqlty.breaking.against | A baseline for sqlty breaking: a git revision, a --save snapshot or schema files |
sqlty.breaking.direction | both (default), forward or backward |
sqlty.trace.server | off (default), messages or verbose: log the protocol in the sqlty output channel |
Fix a file on every save with source.fixAll.sqlty, which is sqlty check --fix, and lay
out its query strings with source.format.sqlty, which is sqlty format:
{
"[python]": {
"editor.codeActionsOnSave": {
"source.fixAll.sqlty": "explicit",
"source.format.sqlty": "explicit"
}
}
}
Any LSP client can run sqlty server for Python files. For Neovim 0.11:
vim.lsp.config("sqlty", {
cmd = { "sqlty", "server" },
filetypes = { "python" },
root_markers = { "pyproject.toml", ".git" },
init_options = { breaking = { against = "main", direction = "both" } },
})
vim.lsp.enable("sqlty")
init_options is optional: without it, no baseline is checked. The server also
colors the SQL of checked strings with semantic tokens; highlighting = { enable = false }
turns that off. VS Code shows one semantic-token provider per file, so the extension
keeps it off there and highlights strings marked --sql with a grammar instead.
For nvim-lint, Vim (vim-lsp, ALE, coc.nvim, :make), Helix and Emacs (Eglot, lsp-mode), see
Neovim, Vim, Helix and Emacs.
Eglot runs one server per major mode: run sqlty next to ty or ruff through
rass python -- sqlty server, with sqlty's highlighting off, or use lsp-mode with
sqlty as an add-on.
With a baseline, the editor also shows what sqlty breaking reports. A finding's
source is sqlty breaking (forward) or sqlty breaking (backward), and it has no
quick fix: the fix belongs to the migration or the code, depending on which ships
first (see sqlty-breaking). The server resolves main when the project loads:
when it moves, save a schema or run sqlty: Restart Server.
sqlty check <file> in a terminal. When it reports the problem and the
editor doesn't, the editor runs another sqlty: check sqlty.path and
sqlty.interpreter, then run sqlty: Restart Server.pyproject.toml or a .sql file reloads the settings and schema
without a restart.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jirikuncar/sqlty --plugin sqlty7 skills in this plugin
/sqltyWrite, type and check raw SQL in Python with sqlty. Use when adding or editing a query in a project that uses sqlty (strings starting with --sql, SQL[T] or SQLTemplate[T] wrappers, a [tool.sqlty] section), when generating Python row types for a query, when typing raw SQL in Go as sqlty.SQL[R, P], or when checking that queries still fit a schema migration before deploying. Routes to sqlty-rewrite, sqlty-check, sqlty-breaking, sqlty-ci and sqlty-adopt for each task./sqlty-adoptIntroduce sqlty into an existing Python project with raw SQL queries, one module at a time. Use when a project doesn't use sqlty yet and you are asked to add it, type its SQL queries, configure [tool.sqlty] (dialect, schema from a database dump or migrations), choose which queries to convert first, mark the ones sqlty can't type yet, or add the first CI gate./sqlty-breakingCheck that a schema change or migration doesn't break the queries running during a rolling deploy, with sqlty breaking, and plan an expand and contract migration. Use when adding, dropping, renaming or changing a table or column, writing a migration, making a column nullable or NOT NULL, reading a sqlty breaking finding (backward or forward), or splitting a schema change into safe pull requests./sqlty-checkRun sqlty check and act on its diagnostics, name the row type of a query, and check query parameters, including the typed parameters of SQL[R, P]. Use when sqlty check reports a diagnostic such as [unknown-column] or [narrow-type], when replacing SQL[tuple[...]] with a TypedDict, dataclass, NamedTuple or pydantic model, when a column may be NULL, when a call passes the wrong parameters, when a join inflates a SUM, AVG or COUNT ([fanout-aggregate], [chasm-join]) or compares a foreign key with a column it does not reference or keys of different tables ([foreign-key-mismatch], [entity-mismatch]), when suppressing a diagnostic with a sqlty ignore comment, or when changing a rule's severity in [tool.sqlty.rules]./sqlty-ciSet up or repair sqlty in pre-commit and CI. Use when adding the sqlty-rewrite or sqlty-check pre-commit hooks, writing a GitHub Actions job that runs sqlty rewrite --check, sqlty check and sqlty breaking, a CI run fails on a sqlty step, a hook fails to install (Python 3.14, Rust toolchain), promoting stale-type or other rules to errors, or keeping committed sources free of SQL[T] wrappers./sqlty-rewriteWrap --sql query strings as SQL[T] with sqlty rewrite, update or remove the wrappers, and keep them in sync after editing a query. Use when writing a new SQL query in Python, editing the SQL inside an SQL[T] wrapper, committing or removing wrappers (sqlty rewrite, sqlty strip, --check, --diff), choosing an import-style, wrapping untyped queries as SQL[UNTYPED], or using the sqlty magic codec (a "coding sqlty" source encoding) instead of committed wrappers.Other plugins' skills for the same job