
Database School Strictly typed SQL with Contra CTO, Gajus Kuizinas
4 snips
Nov 20, 2025 Gajus Kuizinas, co-founder and CTO of Contra, shares insights on creating high-ownership engineering cultures and developing strict runtime-validated SQL through his Slonik library. He discusses the frustrations of traditional ORMs, the breakthrough of JavaScript template tags for safe SQL, and the innovative SafeQL for real-time schema checks. Gajus also introduces Loom-driven development, a tactic for speeding up reviews and improving context. Tune in to explore the evolution of developer experience and schema integrity!
AI Snips
Chapters
Transcript
Episode notes
Raw SQL With Safer Template Tags
- Raw SQL plus template tags preserves readability while preventing injection by sending strings and parameters separately.
- Gajus argues this keeps queries debuggable and avoids costly ORM learning curves.
Validate Every Query At Runtime
- Add runtime validation for every query to catch schema drift early using Zod or similar tools.
- Prioritize loud failures so you fix contract mismatches before they silently corrupt behavior.
Composable SQL Fragments
- SQL template fragments are composable objects that can be merged and renumber parameter binds automatically.
- This enables conditional query composition while keeping the final SQL readable and validated.
