TypeSQL
A library that checks SQL within TypeScript and infers result row and parameter types.
What does it do?
First, prepare a DB type describing the tables from migrations, a live database, Kysely, Drizzle, Prisma, or manual definitions. Create sql from a driver client, import the schema, and write a query; the TypeScript type checker then interprets the SQL. In the editor, developers can hover to inspect result row types and see errors underlined. The VS Code extension provides table and column completion and syntax highlighting inside sql() strings. It supports PostgreSQL and SQLite.
Key features
- Infer result row and parameter types for SQL queries
- Show SQL errors during type checking
- Check queries without code generation or a build step
- Provide table and column completion and syntax highlighting in VS Code
- Support PostgreSQL and SQLite