Getting started
Install
Section titled “Install”The pgzest command line — the language server included:
cargo install pgzest --lockedor a prebuilt binary (macOS arm64, Linux x64 and arm64, Windows x64) from the GitHub releases.
The editor: the pgzest extension, from the
VS Code Marketplace
or Open VSX (VSCodium,
Cursor…). It ships its own pgzest on those platforms — see
Editor.
For Rust code, the crates come from crates.io: see Typed queries in Rust.
Try the demo
Section titled “Try the demo”Prerequisites: Rust (the version is pinned by
rust-toolchain.toml), Node.js 24 or later for the VS Code extension, and
Docker for PostgreSQL 18.
git clone https://github.com/Creatiwity/pgzestcd pgzestmake bootstrap # Rust and npm dependencies, checks the toolingmake demo # VS Code on examples/demo, with the pgzest extensionmake demo-run # the demo's Rust program against PostgreSQL 18 (Docker)examples/demo is a small ordering application written like a real
project — a declarative schema, generated migrations, named queries, Rust
code using them, a traced trigger. Its README.md is a guided tour: hover
a query, break a column name, generate a migration, read a trace.
make demo opens VS Code with the extension loaded in development mode:
nothing is installed in your VS Code.
Set up a project
Section titled “Set up a project”A project is a directory with a pgzest.toml; the CLI and the editor
find it by walking up from the file they work on.
[postgres]version = 18
[schema]directory = "schema" # the CREATE TABLEs, functions, triggers…
[queries]directory = "queries" # the named queriesThe schema can also come from existing migrations — numbered files, Prisma or Diesel layouts, read as they are:
[migrations]directory = "prisma/migrations"Check the project:
pgzest check schema/*.sql queries/*.sqlEvery option: pgzest.toml.
- Generate Rust from the queries: Typed queries in Rust.
- Move the schema to declarative files and generate migrations: Schema and migrations.
- Use it in the editor: Editor.
pgzest is made by Creatiwity, free and open source under the MIT or Apache-2.0 license.