scalikejdbc
ScalikeJDBC is a Scala library that wraps JDBC to provide type-safe, ergonomic database access with QueryDSL support. It enables developers to write raw SQL queries efficiently while offering an optional O/R mapper (scalikejdbc-orm) for more complex relational data handling.
Key facts
Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.
| Field | Value |
|---|---|
| Repository | scalikejdbc/scalikejdbc |
| Owner | scalikejdbc |
| Primary language | Scala |
| License | Apache-2.0 — OSI-approved |
| Stars | 1.3k |
| Forks | 228 |
| Open issues | 42 |
| Latest release | 4.3.5 (2025-08-16) |
| Last updated | 2026-07-07 |
| Source | https://github.com/scalikejdbc/scalikejdbc |
What scalikejdbc is
ScalikeJDBC is a JDBC abstraction layer for Scala featuring connection pooling, string interpolation-based query building, and an optional ORM with join/eager-loading capabilities. Core library is lightweight; orm extension adds ActiveRecord-style CRUD patterns and association handling to reduce N+1 query problems.
Get the scalikejdbc source
Clone the repository and explore it locally.
git clone https://github.com/scalikejdbc/scalikejdbc.gitcd scalikejdbc# follow the project's README for install & configurationNeed it deployed, integrated, or customized instead? DEV.co ships production installs.
Best use cases
Implementation considerations
- JDBC driver versions must match database target (H2 2.2+, MySQL, PostgreSQL drivers specified separately). Dependency version alignment is critical.
- Connection pool configuration (ConnectionPool.singleton or custom) must be initialized before first query. Multi-tenancy or complex pool scenarios require custom session providers.
- Type safety in QueryDSL requires entity case classes and extractor definitions. Boilerplate is minimal but non-zero compared to raw JDBC.
- ORM association eager-loading (includes method) and join query semantics require careful schema design; lazy initialization can lead to N+1 if misapplied.
- Logging integration (logback shown in examples) needed for production debugging; no built-in query logging visible in excerpts—third-party interceptors may be required.
When to avoid it — and what to weigh
- Non-Scala JVM projects — ScalikeJDBC is Scala-first. Java teams should evaluate HikariCP + Spring Data JPA or Hibernate instead.
- NoSQL or polyglot persistence — ScalikeJDBC is SQL-relational only. Projects requiring MongoDB, DynamoDB, or mixed datastores need dedicated drivers or polyglot frameworks.
- GraphQL or REST API generators — ScalikeJDBC does not generate APIs from schemas. Teams needing automatic GraphQL/OpenAPI exposure should pair it with separate code generation tools or switch to JPA/Hibernate with Quarkus.
- Organizations with strict ORM adoption policies — If enterprise standardizes on full ORMs (Hibernate, EclipseLink), ScalikeJDBC's SQL-centric approach may conflict with governance and training investments.
License & commercial use
Apache License 2.0 (permissive OSI license). Copyright held by scalikejdbc.org. Source code and binaries explicitly licensed under Apache 2.0 terms.
Apache License 2.0 permits commercial use, modification, and distribution with reasonable conditions (including liability/warranty disclaimers and license text reproduction). No commercial support, SLA, or indemnification visible in data. Requires in-house support capability or independent commercial support arrangement.
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 | Low |
| DEV.co fit | Good |
| Assessment confidence | High |
JDBC-level SQL injection is mitigated by parameterized queries (string interpolation with `${}` syntax). Connection pooling and JDBC driver credentials must follow standard secrets management practices (environment variables, vaults). No security audit, penetration test results, or vulnerability disclosure policy visible in data; users inherit standard JDBC and driver vulnerability exposure.
Alternatives to consider
Slick (Typesafe Reactive Relational Mapper)
Scala-native with async/reactive support and functional composition. Choose if non-blocking database access and async pipelines are required; ScalikeJDBC is simpler for standard blocking workloads.
Doobie (Scala/Haskell-inspired)
Pure functional with strong type safety via effect systems (Cats Effect). Choose if your codebase requires functional composition and explicit effect control; ScalikeJDBC is less functional but more imperative-friendly.
Quill (Compile-time macro SQL DSL)
Compile-time SQL generation with optional runtime fallback. Choose if metaprogramming safety is critical; ScalikeJDBC is runtime-based with lower compile-time overhead.
Build on scalikejdbc with DEV.co software developers
Our Devco team can review your data layer architecture, assess ORM vs. SQL-first tradeoffs, and guide integration with Play Framework or microservices. Let's build your persistence layer with confidence.
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.
scalikejdbc FAQ
Does ScalikeJDBC support async/non-blocking I/O?
Is connection pooling built-in?
How does the ORM (scalikejdbc-orm) differ from Hibernate?
Can I use ScalikeJDBC with Kotlin or Java?
Custom software development services
Need help beyond evaluating scalikejdbc? DEV.co is a software development agency offering software development services and web development for teams of every size. Our software developers and web developers build custom software, web applications, APIs, and open-source databases integrations — and maintain them long-term.
Ready to evaluate ScalikeJDBC for your Scala stack?
Our Devco team can review your data layer architecture, assess ORM vs. SQL-first tradeoffs, and guide integration with Play Framework or microservices. Let's build your persistence layer with confidence.