Please log in to watch this conference skillscast.
This workshop will provide a hands-on introduction to the latest version of Typesafe's relational database library, Slick. The session aims to demystify Slick, providing both a guide to the basics and a deep dive into the major concepts. It is aimed at intermediate Scala developers, but assumes no prior knowledge of any version of Slick.
Slick 3 is the industry standard library for accessing relational databases in Scala. It provides many benefits, such as a fully asynchronous interface and strong compile-time type-checking, but comes with a cost in terms of complexity. Many experienced Scala developers have difficulty becoming productive with Slick, and beginners often find it to be a significant hurdle.
The session will be divided roughly into four sections:
Getting Started - You will run through the basics of setting up a project and creating a database layer using the Cake pattern. You will define some data tables, configure a database connection, and run some simple queries to test everything is working.
Queries - You will take a close look at Slick's query DSL, including the relationships between tables, columns, and queries. You'll discuss how to filter, project, and join queries to retrieve the desired results.
Actions - You will look at sequencing queries using Slick's Action monad. You will start with simple cases such as running queries one after the other, and proceed to more complex call graphs involving interleaved SQL and Scala code.
Tips and Tricks - You will finish with a set of tips for effective use of Slick, including structuring application code, modelling primary keys, mapping custom data types, and debugging errors at compile and run time.
Code and setup instructions are available in this Github repo.
YOU MAY ALSO LIKE:
- Scala eXchange London 2019 (in London on 12th - 13th December 2019)
- Scalax2gether Community Day 2019 (in London on 14th December 2019)
- Functional Interpreters and You (SkillsCast recorded in December 2018)
- Lightbend Akka for Scala - Professional (in London on 11th - 12th November 2019)
- Advanced Scala with Dick Wall (in London on 9th - 11th December 2019)
- Code Kata: Yilin Wei - Optics with Monocle (in London on 22nd October 2019)
- Don’t keep it to yourself - openness and honesty in the workplace (in London on 30th October 2019)
- Lightning Talk: Generating Castles for Minecraft™ using Haskell (SkillsCast recorded in October 2019)
- Abstract Data Types In The Region Of Abysmal Pain, And How To Navigate Them (SkillsCast recorded in September 2019)
Workshop: Essential Slick: Hands On With Slick 3
Dave is a developer, trainer, and partner at underscore.io. He has spent over a decade programming, speaking at conferences, and writing books on functional programming.