Tyqu: Typesafe SQL Queries in Scala
summary
Tyqu is a LINQ-like Scala library that guarantees type safety for query shapes and returned rows by generating compile-time structural types while doing runtime SQL generation; it uses Scala 3 features (match types, macros, type-level ops, explicit nulls) and demo code runs against a Disco sample DB and returns real rows. The library currently emits many subqueries (joins often become subqueries), does not yet support insert/update/delete or explicit join clauses, has nearly working prepared-query support, and currently compiles on Scala 3.2 (Scala 3.3 causes a compiler crash).
AI-written summary · about
chapters (17)
- 0:00Introduction
- 0:29Story of Tyqu
- 3:09Disco Database
- 3:54Query Problems
- 5:17Query Problems Examples
- 8:24Why Scala
- 9:03Structural Types
- 11:30Indot
- 12:19Tyqu schema
- 13:38Querying
- 16:48Demo
- 23:03Tyqu Implementation
- 24:32Query Builder
- 28:49Translation
- 31:11Future work
- 34:13Insert update delete
- 35:15Conclusion
related talks
49mScylla, Charybdis, and the mystery of Quill
24mNamedTuples in Action
43mIt quacks but it’s not a duck structural typing in Scala 3
48mCompositional, Expressive, Performant Database Queries: Choose 3
49mType level Programming in Scala
35mLiteral types what they are good for
19mLogically Qualified Types for Scala 3
31mGoing structural with Named Tuples
