Plain .sql files, zero DSL tax
Write real SQL—CTEs, RETURNING, MERGE, json_agg, views—and import .sql files directly as typed TypeScript modules.
Write real SQL in plain .sql files. Get database-verified types, instant tsc checks, and zero query-builder overhead—for SQLite and Postgres.
Only hyper-sql pull talks to a database. Builds, CI, and your editor read only your .sql files and the committed sql.lock.
Import a .sql file just like a .ts module. TypeScript's content mapper generates flat, concrete interfaces so tsc and IDE autocomplete stay fast even on large schemas.
The ergonomics of typed database access without giving up real SQL or paying ORM and query-builder overhead.
Use the full power of SQLite and Postgres—nested json_agg / json_group_array rows, bulk unnest inserts, MERGE, and CTEs—so you fetch or write graphs in one query instead of N+1 ORM calls.
Static queries compile to constant pre-numbered SQL strings, dynamic variants are cached once, SQLite caches prepared statements, and rows decode from positional arrays straight into fixed-shape objects.
tsc & snappy autocompleteBecause types are resolved by the database and emitted as flat Params and Row interfaces, TypeScript doesn't grind through deeply nested conditional types on every keystroke.
Types aren't wishful casts: every cell is validated against sql.lock at runtime (catching unsafe integers beyond ±2⁵³, unexpected NULLs, and JSON drift), and Postgres transactions guard against common misuse.
Zero production dependencies and no bundled driver—pass your existing node:sqlite, pg.Client, or custom client. Runs on Node 24+, in the browser playground, and natively via HyperTS.
Commit sql.lock alongside your queries. Build machines never need a running database, and hyper-sql pull --check fails CI if someone forgets to re-pull after editing SQL.
Using Claude Code, Antigravity, or another coding agent? The package ships a ready-to-link agent skill with the full workflow, annotation and dynamic-SQL references, error catalog, and runnable examples.