zio-quill
ZIO Quill is a Scala library that lets you write database queries as compile-time-safe code blocks, translating them to SQL or CQL at build time rather than runtime. It eliminates boilerplate schema mapping and provides early error detection by validating queries against the database during compilation.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | zio/zio-quill |
| Owner | zio |
| Primary language | Scala |
| License | Apache-2.0 — OSI-approved |
| Stars | 2.2k |
| Forks | 352 |
| Open issues | 358 |
| Latest release | v4.8.6 (2025-07-17) |
| Last updated | 2026-07-07 |
| Source | https://github.com/zio/zio-quill |
What zio-quill is
Quill implements a Quoted Domain Specific Language (QDSL) that parses Scala code quotations at compile time into an Abstract Syntax Tree (AST), then generates optimized SQL/CQL strings with zero runtime overhead. It supports JDBC, Cassandra, Spark SQL, PostgreSQL, MySQL, and ScalaJS targets, with Scala 3 support via ProtoQuill.
Get the zio-quill source
Clone the repository and explore it locally.
git clone https://github.com/zio/zio-quill.gitcd zio-quill# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- Compile-time validation requires database schema availability at build time; configure contexts carefully to avoid build-time performance penalties.
- Case class schema mapping must be kept in sync with actual database schemas; no automatic schema versioning or migration tooling built in.
- Quoted block syntax and macro expansion can produce cryptic compile errors; invest time in error interpretation and IDE support (Eclipse, IntelliJ).
- Scala 2 vs. Scala 3 support split between Quill and ProtoQuill; verify which version your project targets before adoption.
- Performance overhead is minimal at runtime, but compile-time AST generation and optional validation can increase build time on large query-heavy projects.
When to avoid it — and what to weigh
- Ad-hoc or dynamic query construction — Quill requires queries to be known at compile time. If you need to build queries dynamically at runtime, use a traditional ORM or query builder instead.
- Rapid prototyping or proof-of-concept work — Compile-time validation and quote block syntax add friction during exploration. Consider lightweight query builders for early-stage prototypes.
- Team unfamiliar with Scala or functional programming — Quill's compile-time metaprogramming and Scala-specific syntax have a steep learning curve. Requires strong Scala expertise to debug and extend.
- Non-JVM or non-Scala ecosystems — Quill is Scala-only. If your stack uses Python, Node.js, or Go, you cannot use it; choose language-native ORM or query libraries instead.
License & commercial use
Licensed under Apache License 2.0 (SPDX: Apache-2.0), a permissive OSI-approved license allowing commercial use, modification, and distribution with standard liability disclaimers.
Apache-2.0 permits commercial use without license fees or restrictions. You may use Quill in proprietary applications, modify it, and distribute compiled binaries. No special commercial license needed. However, verify your legal team's comfort with Apache 2.0 attribution requirements in production environments.
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 |
Compile-time query generation eliminates most SQL injection risks by design (queries are static, not user-constructed). No sensitive data handling, encryption, or audit logging apparent from code excerpt. Depends on JDBC/Cassandra driver security posture for network and credential handling. Review driver versions and TLS configuration for production deployments. No security policy or incident response process mentioned.
Alternatives to consider
Doobie
Lightweight Scala query library with similar compile-time safety but simpler syntax and narrower scope; good if you want less metaprogramming complexity and more manual control.
Slick
Another Scala query DSL with strong type-safety and lazy evaluation model; mature but larger footprint and different API philosophy; consider if team prefers reactive/streaming abstractions.
JPA/Hibernate
Traditional ORM for JVM polyglot teams; supports dynamic queries and schema generation but with higher runtime overhead and less type safety than Quill.
Build on zio-quill with DEV.co software developers
Our engineers can help you architect compile-time query systems or migrate existing Scala applications to Quill. Contact us to discuss your specific database and performance requirements.
Talk to DEV.coRelated on DEV.co
Explore the category and the services that help you build with it.
zio-quill FAQ
Does Quill require a database connection at compile time?
Can I use Quill with Scala 3?
What databases does Quill support?
Is Quill suitable for microservices?
Software development & web development with DEV.co
DEV.co helps companies turn open-source tools like zio-quill into production software. Our software development services cover the full lifecycle — architecture, web development, integration, and maintenance — delivered by software developers and web developers who ship. Engage our software development agency to implement or customize it for your open-source databases stack.
Need Scala database expertise?
Our engineers can help you architect compile-time query systems or migrate existing Scala applications to Quill. Contact us to discuss your specific database and performance requirements.