Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Slick - The Structured Way

Slick - The Structured Way

Slick (part of the Typesafe stack) is a modern database query and access library for Scala, based on functional principles. It allows you to write queries as if you are working with regular Scala collections.

In this presentation we’ll have a deep dive into how you can use this library in real projects. How to map your tables and queries to structured objects, how to create more advanced queries with multiple joins, how to setup integration tests against an in-memory database and how you can integrate Slick with the Play Framework are all questions which will have been answered at the end of this session.

Avatar for Yennick Trevels

Yennick Trevels

June 04, 2014

Other Decks in Programming

Transcript

  1. ESSENTIALS Build queries with Scala Lifted embedding Query result à

    result rows ID TITLE ID FIRSTNAME LASTNAME 1 “Scala” 10 Yennick Trevels 1 “Scala” 11 Eric Loots 2 “Slick” 12 Filip Maelbrancke
  2. DEFINING THE RESULT Slick meetings.list è List[Meeting] meetings.first è Meeting

    or NoSuchElementException meetings.firstOption è Option[Meeting]
  3. OUTER JOINS (THE PROBLEM) ID TITLE ID MEETING_ID ATTENDEE_ID 1

    “Scala” NULL NULL NULL 2 “Slick” 10 2 20 3 “Slick” 11 2 21 ID TITLE 1 “Scala” 2 “Slick” ID MEETING_ID ATTENDEE_ID 10 2 20 11 2 21 Left Join Ref: http://www.slideshare.net/skillsmatter/patterns-for-slick-database-applications
  4. THOUGHTS ON SLICK + Lightweight + Level of control +

    Production ready -  Documentation -  Generated Queries (readability)
  5. Development Coaching Training Hello Scala seminar June 25th 2014 Fast

    Track to Scala October 09th 2014 Fast Track to Akka with Scala November 04th 2014 [email protected] CONTACT US