OVERVIEW:

Slick is a Functional Relational Mapping (FRM) library for Scala that makes it easy to work with relational databases.

Slick brings the database model to Scala developers so they don't need to write SQL code or struggle with ORMs. We believe that FRM has emerged as the ideal way to talk to a relational database in the functional programming world.

Slick's FRM integrates databases into Scala, allowing relational data to be queried and processed in the same way as in-memory data using ordinary Scala classes and collections. Slick also provides a single unified interface across to manage your project.

This enables full control over when a database access happens and which data is transferred.

  • Work with stored data as if they are normal Scala collections.
  • Retain full control over when a database access happens and which data is transferred.
  • Write your database queries in Scala instead of SQL, thus profiting from the static checking, compile-time safety and compositionality of Scala.

Write database queries in Scala

Because Slick provides a front-end layer that integrates queries transparently using ordinary Scala types, queries can be processed and validated at compile time, even in user-provided database backends. Slick also allows for writing SQL queries, which are executed with an API optimized for Scala instead of using JDBC.

Query and connect with ease

Slick features an extensible query compiler that can generate code for different back-ends. The following database systems are directly supported for type-safe queries (using the query language or Scala code lifted to database queries):

  • Derby/JavaDB
  • H2
  • HSQLDB/HyperSQL
  • Microsoft Access
  • MySQL
  • PostgreSQL
  • SQLite
  • DB/2
  • Oracle
  • Microsoft SQL Server

Next steps for commercial database usage

Using the Slick Extensions package is free for evaluation and development. Production use with Oracle, IBM DB2, and Microsoft SQL Server requires a commercial Typesafe Subscription.

GETTING STARTED:

To get started with Slick, we recommend checking out the following resource

Code Samples & Tutorials

Hello Slick! (Reactive Platform 15v01)

This tutorial will get you started with a simple standalone Scala application that uses Slick.

DETAILS

Slick Direct Embedding (Reactive Platform 15v01)

This tutorial shows you how to use Slick's experimental Direct Embedding query API.

DETAILS

Slick Plain SQL Queries (Reactive Platform 15v01)

This tutorial shows you how to use Plain SQL queries with Slick.

DETAILS

Videos & Webinars

Introducing Slick 2.0.0!

Stefan Zeiger, Slick tech lead, leads a webinar about the newly released Slick 2.0. Slick is the most efficient library available for functional programmers connecting applications to relational databases.

Watch Now

Here are some additional ideas on how to get started:

Visit the Typesafe Resource Center or Go Typesafe
Read the full documentation
Visit the community website
Participate on Stack Overflow
Join the Mailing List
Contribute at GitHub

SUBSCRIPTION:

Ensure the Success of Your Reactive Application

If you plan to develop a commercial application, your business could benefit from a relationship with Typesafe. The Typesafe Together annual subscription program is designed to mitigate risk and ensure the successful launch and operation of your application by delivering certified builds and amazing service throughout the entire project lifecycle—from prototyping to production.

LEARN MORE ABOUT SUBSCRIPTIONS