Polymorphic Record Types in a Limited Embedding
summary
Shows how Slick’s lifted embedding uses a Shape abstraction and Scala’s functional dependencies (added in 2.8) to treat ordinary Scala tuples and HLists as database record types, with concrete encodeRef/toNode and pack/packedShape implementations. Demonstrates a simplified toy Slick ABuilder, the fix for encoding paths by packing mapped results, and a generated suite of tuple shapes up to 22. The implementation compiles and runs, and HList support requires only a few lines.
AI-written summary · about
chapters (13)
- 0:00Introduction to slick
- 2:00Lifted embedding overview
- 4:21Abstract syntax tree design
- 6:26The rep type hierarchy
- 9:38Primitive values and tables
- 16:30Implementing tuples
- 19:26Polymorphic record types
- 21:12Functional dependencies
- 26:43Understanding shapes
- 32:21Shape implementation details
- 35:05Query execution and logic
- 36:44Filter and map operations
- 42:01HLists and conclusion
related talks
45mImplementing the Active Slick
48mCompositional, Expressive, Performant Database Queries: Choose 3
34mLightweight Relations
43mHow to pretend we don't have a database
43mHow to pretend we don't have a database
24mNamedTuples in Action
52mPattern Functors...
44mRecursion Schemes Without the Barbed Wire (Part 1)
