Skip to content

Examples

Choose the smallest example that answers the question. Inline proofs teach one contract, recipes pair one task with compiler and renderer evidence, and runnable applications include database setup, generated evidence, driver lifecycle, and real-database tests.

Inline proofs and recipes

Runnable applications

The repository applications use only public entrypoints. Workspace dependencies resolve to the current source tree, while each database driver remains an explicit application dependency.

ExampleDriver capabilities exercisedDatabase setup
PostgreSQLQueries, mutations, transactions, prepared queries, cursors, pipelines, COPY, cancellation, routing, observation, validationPinned PostgreSQL container
MySQLQueries, mutations, transactions, prepared queries, streams, LOAD DATA, cancellation, routing, observation, validationPinned MySQL container
SQLiteQueries, mutations, transactions, prepared queries, streams, small batches, validation, explicit capability discoveryRecreated local database file
PostgreSQL + SQLiteTwo grammars, configs, generated contracts, and drivers combined by one application servicePinned PostgreSQL container and local SQLite file
Custom grammarA third-party grammar using only published contractsIn-memory conformance fixture

Each database example contains its schema, typed-sql config, generated snapshot, focused capability modules, adapter execution, service-free Poku tests, and a Poku suite that runs against the real driver. The checked-in generated snapshot enables editor inference as soon as the workspace opens.

Run an example from the repository

Install and build the current source tree first:

sh
pnpm install --frozen-lockfile
pnpm build

Run every example through generation, analysis, its executable entrypoint, and its real database suite:

sh
pnpm e2e:examples

Pass postgres, mysql, sqlite, or multi-database to node examples/e2e.mjs to run one example. Set TYPED_SQL_CONTAINER_ENGINE=podman to use Podman for the container-backed examples. PostgreSQL and MySQL containers are always removed in a finally path. SQLite uses a recreated local file.

The normal pnpm test gate keeps a service-free construction suite for each example. CI also runs the real database suites as a protected three-entry matrix, so the documented adapter paths are executable rather than illustrative snippets.

Applications outside this repository install released package versions rather than workspace:*. The source code and API usage are otherwise the same.

To inspect exact hovers in Zed, install the development extension once and open a database example directory as its own workspace, such as zed examples/postgres. Each example includes a matching .zed/settings.json and the language server as a workspace development dependency. See Editor setup for the extension and other clients.

Released under the MIT License.