DEV.co
Open-Source Databases · slick

slick

Slick is a Scala library that lets you write database queries using Scala syntax rather than raw SQL, with strong type safety and the ability to compose queries like Scala collections. It supports multiple databases (PostgreSQL, MySQL, Oracle, SQLServer, and others) and integrates with modern Scala async patterns via Cats Effect and FS2.

Source: GitHub — github.com/slick/slick
2.7k
GitHub stars
611
Forks
Scala
Primary language
BSD-2-Clause
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositoryslick/slick
Ownerslick
Primary languageScala
LicenseBSD-2-Clause — OSI-approved
Stars2.7k
Forks611
Open issues409
Latest releasev3.6.1 (2025-05-16)
Last updated2026-07-04
Sourcehttps://github.com/slick/slick

What slick is

Slick provides a strongly-typed, composable query API for Scala with an advanced query compiler that generates database-specific SQL from Scala code. It features asynchronous operations returning `F[R]` for any `cats.effect.Async` instance, streaming via FS2, and code generation from database schemas. Supports 9+ major RDBMS backends via JDBC.

Quickstart

Get the slick source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/slick/slick.gitcd slick# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Type-safe Scala backend queries

Build backend services in Scala where compile-time query safety and IDE autocomplete reduce SQL injection risks and catch type mismatches at compile time rather than runtime.

Multi-database applications

Write database logic once in Scala and deploy against PostgreSQL, MySQL, Oracle, or SQLServer without rewriting queries, leveraging Slick's query compiler to generate compatible SQL.

Functional Scala stacks

Integrate seamlessly with Typelevel ecosystem (Cats Effect, FS2, ZIO) for purely functional, composable async database operations with streaming support.

Implementation considerations

  • Explicit table mappings via `Table` subclasses and `TableQuery` must be written or code-generated; verify code generation tools fit your schema or maintain manually.
  • Requires Scala 2.13 or 3.x; confirm target Scala version aligns with your project and dependency ecosystem (Cats Effect 3 is mandatory for async).
  • JDBC driver versions are tested against specific database server versions (e.g., PostgreSQL latest, SQLServer 2022); pin drivers and verify compatibility before deployment.
  • Asynchronous `db.run()` returns effect types (`IO`, `Task`, etc.); teams must understand async/await patterns and effect composition to avoid blocking or resource leaks.
  • Streaming via FS2 requires understanding FS2's `Stream` model for large result sets; standard collection-based queries may suffice for smaller datasets.

When to avoid it — and what to weigh

  • Non-Scala projects — Slick is Scala-only; teams using Java, Python, Go, or other languages should not adopt it. Consider JOOQ (Java), SQLAlchemy (Python), or sqlc (Go).
  • Heavy NoSQL/document workloads — Slick is RDBMS-focused. If your primary need is MongoDB, DynamoDB, or graph databases, use native drivers or specialised ORMs instead.
  • Rapid prototyping with minimal schema control — Slick requires explicit, code-generated table mappings. Projects needing auto-migration or zero-config ORM magic (like Django ORM or Hibernate) may find it verbose.
  • Teams unfamiliar with Scala or functional patterns — Slick's API leverages Scala collections, for-comprehensions, and functional composition. Adoption without Scala expertise and buy-in will be slow and error-prone.

License & commercial use

BSD 2-Clause (Simplified) license is a permissive OSI-approved license permitting commercial and private use, modification, and distribution with minimal restrictions (retain copyright notice and license text).

BSD 2-Clause is permissive and commercial-friendly. No restriction on commercial applications, but review license text to ensure compliance with your legal and compliance requirements.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationStrong
License clarityClear
Deployment complexityLow
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Slick's type-safe query API reduces SQL injection risks by parameterising queries automatically. However, review JDBC driver security posture (e.g., driver version vulnerabilities), use secure connection credentials, and enforce TLS for database connections. No security audit data provided; conduct threat modelling for sensitive workloads.

Alternatives to consider

JOOQ

Java-based, strongly-typed SQL generator with similar compile-time safety; better if your stack is Java/Kotlin and you need SQL-first semantics.

Quill

Scala-native query language with compile-time query generation; lighter-weight than Slick and good for simple, functional-first workflows.

Doobie

Scala functional library for raw SQL composition; minimal abstraction, stronger functional purity; suitable if you prefer explicit SQL over DSL queries.

Software development agency

Build on slick with DEV.co software developers

Slick is ideal for teams building functional Scala applications with type-safe database access. Assess its fit by prototyping a query on your target database and confirming JDBC driver compatibility. Contact Devco to architect a pilot or review integration with your Typelevel stack.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

Related on DEV.co

Explore the category and the services that help you build with it.

slick FAQ

Does Slick generate migrations?
No. Slick manages table schema representation and code generation from existing schemas, but does not generate or run DDL migrations. Use Flyway or Liquibase for schema versioning.
Can I use Slick with non-Scala JVM languages?
Slick is Scala-only; Java/Kotlin projects cannot directly use it, though interop is theoretically possible (not recommended). Use JOOQ or Hibernate for Java.
What effect type should I use?
Use any type with a `cats.effect.Async` instance: `cats.effect.IO`, ZIO `Task`, or custom. Cats Effect 3 is required; older versions are not supported.
Is Slick suitable for GraphQL/REST APIs?
Slick is a data access layer. Compose it with http4s, Play Framework, or similar Scala web libraries to serve GraphQL/REST. No built-in API support.

Software development & web development with DEV.co

From first prototype to production, DEV.co delivers software development services around tools like slick. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across open-source databases and beyond.

Ready to evaluate Slick for your Scala backend?

Slick is ideal for teams building functional Scala applications with type-safe database access. Assess its fit by prototyping a query on your target database and confirming JDBC driver compatibility. Contact Devco to architect a pilot or review integration with your Typelevel stack.