Raw PostgreSQL, with zest: checked the way PostgreSQL would, without a database — diagnostics, hover, completion and macro expansion for SQL, PL/pgSQL and SQL in Rust strings.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Raw PostgreSQL, with zest. pgzest
checks your SQL the way PostgreSQL would — against your schema and
migrations, without a database — and this extension brings its answers
into the editor as you type.
Features
Diagnostics in .sql and .pgsql files, and inside the SQL strings
of sql! and query! in Rust files: unknown tables and columns, type
errors, function and operator resolution, PL/pgSQL bodies, lint rules.
Hover: the type and nullability of a column, a variable or an
expression; the descriptor of a named query (parameters, columns,
number of rows).
Completion: keywords, tables, the columns of the relations in scope.
Macro expansion: Cmd+Alt+E / Ctrl+Alt+E opens the SQL a macro
desugars into.
Highlighting of $parameters and @fragments, inside Rust strings
too.
The extension reads the project's pgzest.toml — the same
configuration as the pgzest CLI, so the editor and CI agree.
Requirements
None on macOS (Apple silicon), Linux (x64, arm64) and Windows (x64): the
pgzest binary that runs the language server ships with the extension.
Elsewhere, install it (cargo install pgzest) and put it on the PATH,
or set pgzest.server.path.
Settings
Setting
Default
Description
pgzest.server.path
""
the pgzest binary to run (pgzest lsp); empty: the shipped one, otherwise pgzest on the PATH