Scala ORM Libraries
Scala ORM Libraries
Scala ORM libraries leverage the fusion of functional and object-oriented programming. Slick maximizes Scala's type system, Doobie offers a pure functional approach based on Cats Effect, and Quill provides compile-time query optimization. They feature type safety and high expressiveness.
GitHub Star Comparison
No | Name | GitHub Stars | Description | Trend | License | Type | Official Site |
---|---|---|---|---|---|---|---|
1 | Slick | ⭐ 2.7k | Slick (Scala Language-Integrated Connection Kit) is "a functional relational mapping (FRM) library for Scala" that provides a type-safe, functional programming paradigm-based database access layer. Unlike traditional ORMs, it allows writing SQL-like queries directly within Scala code and ensures query correctness through compile-time type checking. With Reactive Streams support, asynchronous processing, and query construction through function composition, it achieves high performance and maintainability in modern Scala application development. | stable | MIT | Library | - |
2 | sqlpp11 | ⭐ 2.6k | sqlpp11 is a type-safe SQL library porting C++11 template technology to Scala. It achieves safe database access through compile-time SQL verification and advanced type system, enabling natural SQL syntax writing while guaranteeing SQL query type safety. | stable | MIT | Library | - |
3 | Doobie | ⭐ 2.2k | Doobie is a functional database access library for Scala that achieves the "perfect fusion of type safety and composability." It features a type-safe API for manual query writing, enabling large-scale query construction through combination and manipulation of query fragments. As a high-freedom library that allows optimized specialized query writing without hiding, it has become the standard choice for functional programming enthusiasts. | stable | MIT | Library | - |
4 | Quill | ⭐ 2.2k | Quill is "a type-safe database access library for Scala" designed as a macro-based database access layer that generates SQL at compile time. Based on the concept of "Compile-time Language Integrated Queries," it leverages Scala's type system and macro capabilities to check query validity at compile time rather than runtime, generating type-safe SQL code. Supporting various databases (PostgreSQL, MySQL, SQLite, H2, Cassandra, MongoDB) and providing both synchronous and asynchronous execution models, it enables high-performance data access in modern Scala applications. | stable | MIT | Library | - |
5 | ScalikeJDBC | ⭐ 1.3k | ScalikeJDBC is a Scala-exclusive database library designed as "a tidy SQL-based database access library for Scala developers" that naturally wraps JDBC APIs and provides easy-to-use APIs. Based on the philosophy that "JDBC stands as a steadfast standard interface. Given its widespread support across most RDBMS, accessing databases remains consistent," it achieves robust and expressive database operations that leverage the full benefits of Scala's type system and functional programming through type-safe QueryDSL and string interpolation SQL queries. | stable | MIT | Library | - |
6 | ZIO SQL | ⭐ 239 | ZIO SQL is developed as "Type-safe, composable SQL for ZIO applications" - a type-safe and composable SQL library for ZIO applications. Designed to enable writing type-safe, type-inferred, and composable SQL queries in ordinary Scala, it helps prevent persistence bugs before they happen and leverages your IDE to make writing SQL productive, safe, and fun. Through functional programming principles and deep integration with the ZIO ecosystem, it provides new options for enterprise-level Scala application development. | stable | MIT | Library | - |