Polymorphic record types in a lifted enbedding
summary
Explains how Slick’s Scala DSL uses a Shape abstraction plus Scala implicits and functional dependencies to treat tuples, nested tuples and HLists as polymorphic record types that can be packed into and unpacked from query AST nodes. Demonstrates a minimal toy-slick implementation (no macros, simplified AST, map/filter) that builds packed reps for collection operations and shows encodeRef/toNode mechanics; literal values throw on encodeRef so pack/unpack is required. Notes that supporting SQL outer-join options adds substantial real-world complexity.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 0:50What is Slick
- 4:20AST
- 7:48Lifted embedding
- 8:37Lifted representation
- 10:14Type R
- 10:59Primitive values
- 12:20Extension methods
- 13:35Tables
- 14:20Columns
- 21:04Examples
- 22:24Implicit example
- 25:44Can build from
- 28:27Implicit shapes
- 34:19Implementation
- 37:15Query
- 47:01H Lists
related talks
48mCompositional, Expressive, Performant Database Queries: Choose 3
24mNamedTuples in Action
45mImplementing the Active Slick
34mLightweight Relations
43mHow to pretend we don't have a database
09mA DSL for My NoSQL Database
37mType safety in the world of graph databases
43mHow to pretend we don't have a database
