TypeSQL
TypeSQL parses Postgres SQL string literals inside TypeScript's type system to produce exact row and parameter types at compile time with no codegen and no database connection. It handles joins with correct nullability, CTEs, subqueries, window functions, INSERT/UPDATE/DELETE with RETURNING, and DDL; at runtime it is a 3.8 KB wrapper for pg or postgres.js and can take a schema from Kysely, Drizzle, or Prisma. It requires TypeScript 7 and supports only Postgres.