SQLBraid
A SQL-first data-access toolkit for TypeScript that keeps ordinary SQL visible in tagged template literals, binds interpolated values safely by default, supports readable conditional SQL directives, and lets a schema validate the returned rows.
SQLBraid is a SQL-first data-access toolkit for TypeScript that lets a developer write ordinary SQL directly rather than translating it through a query-builder's own syntax. Interpolated values inside a tagged SQL template are bound as parameters rather than inserted as text by default, with explicit helper functions available for identifiers and other structural SQL that genuinely needs to vary, and a separate raw-insertion helper for trusted SQL that the project warns should never receive untrusted input.
Special comment directives inside the SQL string handle conditional logic, such as an if or a where clause that only appears when a given value is defined, without breaking up the readability of the SQL text itself, and a companion compiler package preserves lazy evaluation for expressions inside a branch that ends up inactive. A declared result type documents the shape of returned rows at compile time only, or a schema object, such as one built with Zod, can be attached to validate and transform rows against that shape at runtime.