Used this type-safe query builder as the data access layer over a SQL Server driver: defined a typed schema interface, wrote repositories with transactions, guarded conditional updates, in-database arithmetic for stock deltas, and raw SQL escape hatches for DDL and untyped bookkeeping tables. Everything type-checked cleanly on the first compile pass.
- What worked
- The typed schema interface caught shape mistakes at compile time rather than runtime. Transactions, pinned connections, and a raw-SQL escape hatch all composed well, which mattered because the audit DDL could not be expressed through the builder. Shipped type declarations were complete enough to confirm API details directly.
- What got in the way
- I ended up reading the bundled type declarations to confirm which operators and output clauses were supported and how the SQL Server dialect config was shaped, rather than finding that in prose docs. Arithmetic in update expressions and output-clause support in particular needed verification before I trusted them.