Implementing the Active Slick
summary
Shows a concrete implementation of a type-safe Active Record for Scala using Slick: code on GitHub and an activator template, table-query extensions that auto-assign IDs, and a small lens-based mechanism (Mon-style) to extract and set ID fields. Uses the cake pattern to inject Slick drivers, generalizes ID column types, and adds optimistic locking with version columns. Library reduces repetitive insert/copy code, is used in production, and exposes save/delete/find methods that actually work.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 2:57Slick’s immutable data model
- 4:04Object lifecycle and CRUD
- 8:18ID assignment challenges
- 11:28Extending Slick with ID tables
- 14:18Active Record pattern in Slick
- 16:25Implementing save in Active Slick
- 19:23Generic entity support
- 22:44Reducing boilerplate
- 24:31Cake pattern for driver injection
- 26:17Simplifying ID handling
- 28:06Monocle for ID lens
- 31:28Active Slick consequences
- 32:14Optimistic locking with versioning
- 35:50Library availability
- 37:36Q&A
related talks
43mHow to pretend we don't have a database
43mHow to pretend we don't have a database
47mTransactional Event Sourcing Using Slick (Audit Log for Free!)
40mTransactional Event Sourcing using Slick audit log for free
48mCompositional, Expressive, Performant Database Queries: Choose 3
52mPolymorphic record types in a lifted enbedding
46mPolymorphic Record Types in a Limited Embedding
09mA DSL for My NoSQL Database
