skunk
Skunk is a functional data access library for Scala that provides type-safe, composable access to PostgreSQL databases. It leverages the Scala ecosystem (Cats, Cats Effect, FS2) to offer modern, purely functional database interactions with built-in resource management and streaming support.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | typelevel/skunk |
| Owner | typelevel |
| Primary language | Scala |
| License | MIT — OSI-approved |
| Stars | 1.7k |
| Forks | 176 |
| Open issues | 97 |
| Latest release | v1.0.0 (2026-04-15) |
| Last updated | 2026-07-08 |
| Source | https://github.com/typelevel/skunk |
What skunk is
Skunk is a Scala library built on Cats Effect and FS2 that abstracts PostgreSQL protocol operations via type-safe, composable programs. It uses scodec for protocol encoding/decoding and provides session management, prepared statements, and streaming query results within a functional effects framework.
Get the skunk source
Clone the repository and explore it locally.
git clone https://github.com/typelevel/skunk.gitcd skunk# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Requires Scala 2.13 or higher (confirm JVM version compatibility for your target runtime).
- Connection pooling and session lifecycle must be managed explicitly via Cats Effect Resource patterns.
- Prepared statement caching and query plan reuse must be architected by the application; no automatic query optimization layer.
- Error handling relies on Cats Effect error channels; custom exception mapping may be needed for application-level error codes.
- Testing requires TestContainers or embedded PostgreSQL; consider dev/test database setup complexity upfront.
When to avoid it — and what to weigh
- Lightweight scripting or one-off queries — The functional programming overhead and Scala compilation time make Skunk less suitable for ad-hoc database scripts or simple CLI tools.
- Multi-database portability required — Skunk is PostgreSQL-only. If your roadmap includes switching databases or supporting multiple backends, consider a more agnostic ORM.
- Team unfamiliar with functional Scala idioms — Skunk assumes fluency with Cats, Cats Effect, and functional composition. Onboarding a non-FP team will require significant learning investment.
- Rapid prototyping without strong type guarantees — The strong typing and compile-time checks, while beneficial long-term, can slow early-stage exploration compared to dynamic ORM alternatives.
License & commercial use
Licensed under MIT (MIT License), a permissive OSI-approved open-source license.
MIT license permits commercial use, modification, and distribution with attribution. No license review required for commercial deployments. However, verify any organizational IP policies regarding OSS consumption.
DEV.co evaluation signals
Editorial assessment — not user reviews. Directional, with an explicit confidence level.
| Signal | Assessment |
|---|---|
| Maintenance | Active |
| Documentation | Adequate |
| License clarity | Clear |
| Deployment complexity | Moderate |
| DEV.co fit | Good |
| Assessment confidence | High |
Skunk uses scodec for protocol encoding and relies on PostgreSQL's native wire protocol. Parameterized queries reduce SQL injection risk if used correctly. Verify that connection pooling is configured with TLS/SSL for production. No known security posture claim is made; conduct threat modeling for sensitive data and review dependency security updates regularly.
Alternatives to consider
Doobie
Also Scala/JVM, Cats Effect-based, but provides higher-level query DSL and JDBC bridge; more approachable for teams valuing convenience over protocol purity.
Slick
Mature Scala ORM with async support; more multi-database portable but less functional-purist; steeper learning curve for some, less transparent query execution.
Quill
Compile-time query generation for Scala; strong type safety; supports multiple databases; different philosophy around query construction and optimization.
Build on skunk with DEV.co software developers
Evaluate team expertise in functional Scala, confirm PostgreSQL-only requirements, and prototype a small query module to assess fit before full adoption.
Talk to DEV.coRelated 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.
skunk FAQ
Does Skunk handle connection pooling automatically?
Can I use Skunk with non-blocking (async) Scala frameworks like Http4s?
What versions of PostgreSQL does Skunk support?
Is there an active community for support and troubleshooting?
Work with a software development agency
Adopting skunk is usually one piece of a larger software development effort. As a software development agency, DEV.co provides software development services and web development expertise — pairing senior software developers and web developers with your team to design, build, and operate open-source databases software in production.
Ready to adopt Skunk for your Scala backend?
Evaluate team expertise in functional Scala, confirm PostgreSQL-only requirements, and prototype a small query module to assess fit before full adoption.