Overview
Explore polymorphic record types in limited embeddings through this Scala Days Berlin 2016 conference talk. Dive into the "lifted embedding" at the core of Slick, Lightbend's relational database library for Scala. Learn how standard Scala language features enable a DSL for working with database tables using syntax similar to Scala collections. Discover the "Shape" abstraction that allows for standard Scala tuples in the DSL with arbitrary nesting, supporting Slick's HList implementation and custom record types. Understand the role of functional dependencies, added in Scala 2.8, in implementing the "CanBuildFrom" abstraction. Follow the progression from toy Slick AST and lifted representation to complex queries, covering topics such as literal primitive values, extension methods, table instances, tuple encoding, and HList shapes. Gain insights into building efficient and flexible database interactions using Scala's advanced type system features.
Syllabus
Intro
Toy Slick AST
Lifted Representation Reply
Literal Primitive Values
Extension Methods
Tables
Building Concrete Table Instances
Naive Tuple Encoding (ScalaQuery)
Polymorphic Record Types
Functional Dependencies: Example
CanBuildFrom
Primitive Shapes
Nested Tuple Shapes
Shape Implementations
Queries: Filter
Queries: Naive Map
Queries: Map
HList Shapes
Taught by
Scala Days Conferences