Skip to content

Write SQL. Keep TypeScript.

SQLBraid adds safe binds, readable dynamic SQL, explicit result contracts, and a small runtime for PostgreSQL, MySQL, MariaDB, SQLite, Oracle, and SQL Server, with Browser WASM and D1 paths.

SQLBraid is a SQL-first TypeScript data-access toolkit. Keep the SQL you know, without a query-builder translation layer, while retaining the boundaries that matter in production.

  • SQL stays visible. Tagged templates preserve ordinary SQL and database-specific features.
  • Values stay bound. Ordinary value interpolation becomes a logical value parameter; the selected driver owns placeholder/materialization transport, while structural SQL requires an explicit helper.
  • Results stay explicit. Declare rows, command, or call, then let runtime checks catch mismatches.
  • Runtime semantics stay honest. Direct connections and pools use different factories; transactions pin one physical connection.
  • Tooling stays optional. Metadata, deterministic code generation, LSP, CLI inspection, and VS Code support do not enter the runtime dependency path.

SQLBraid does not infer arbitrary SELECT result types, hydrate object graphs, or hide SQL behind a model DSL. Your SQL and declared row type remain the contract. Standard Schema mapping is available when a row needs validation or transformation.

For the database-to-application value boundary, see data representations and numeric fidelity. Driver profiles document the raw integer, decimal, JSON, temporal, and binary values that the runtime can actually receive.

1.0.0 GA stabilizes the public API. Because driver capabilities vary, check the runtime and driver support matrix for the exact feature set of your database, driver, and runtime tuple.

See release notes and limitations for details.