playframework/anorm
61.2
Adequate · 20 September 2026
9.7k
lines of production code
Scala
primary language
1
measurement over time
What this system is
This system is the Anorm library for Scala, providing a lightweight, type-safe API for executing SQL queries and parsing result sets. It supports both Scala 2.13 and Scala 3 through version-specific macro implementations for row parsing and parameter binding. The library integrates with reactive streams via Akka and Pekko, and includes specialized modules for PostgreSQL JSON/UUID handling and Enumatum enum support.
How it got here
2011–2015 — Anorm core library release and modernization
6 changes.
This period focused on the initial release of the Anorm core library, establishing its SQL execution and result parsing API with comprehensive test coverage. The project simultaneously modernized its infrastructure by upgrading to sbt 2.0.8 with Scala 3 support, dropping older Scala versions, and removing internal implementation files to streamline the codebase.
2016–2017 — Akka Streams and PostgreSQL integration
5 changes.
This period focused on expanding Anorm's capabilities by introducing Akka Stream integration for reactive SQL queries and adding a dedicated PostgreSQL module with JSONB and UUID support. Comprehensive test coverage was added to ensure correct resource management, data mapping, and error handling for these new features.
2021–2026 — Scala 3 migration and module separation
9 changes.
The project focused on achieving full Scala 3 compatibility by introducing dedicated macro and tokenizer implementations for both Scala 2 and Scala 3. This period also involved modularizing the codebase by extracting Joda-Time support into a separate module and adding new integrations for Enumatum and Pekko Streams.
Features
Add Anorm integration for Enumatum enums
This release adds support for using Enumatum enums directly with the Anorm SQL library. It introduces new traits and typeclass instances that allow Enumatum enums to be read from database columns and written as SQL parameters. The integration supports standard string-based enums with case-sensitive, case-insensitive, lowercase-only, and uppercase-only parsing modes, as well as value-based enums (Int, Long, Short, String, Char, Byte) that map to their underlying primitive database types.
enumeratum · high confidence
Add Pekko Streams integration for reactive SQL queries
The pekko module now provides \PekkoStream\, allowing SQL queries to be executed as reactive \org.apache.pekko.stream.scaladsl.Source\ streams. This enables users to process database results incrementally using Pekko Streams, with proper resource management for JDBC connections and result sets, and includes tests verifying stream behavior, resource cleanup, and error handling.
pekko · high confidence
Add PostgreSQL module with JSON and UUID support
Introduces a new PostgreSQL-specific module that enables seamless integration with Play Framework's JSON library. Users can now store and retrieve \JsValue\ and \JsObject\ columns as JSONB, pass optional JSON values as NULL, and use UUID parameters in SQL queries via the \postgresql\ package.
postgres/src/main · high confidence
Add Scala 3 macro implementations for Anorm
Introduces a new set of Scala 3-specific macro implementations in the \anorm.macros\ package to support the Scala 3 compiler. This includes \RowParserImpl\ and \SealedRowParserImpl\ for generating row parsers for case classes and sealed traits, \ToParameterListImpl\ for converting case classes and sealed traits to SQL parameters, and specialized handlers for value classes (\ValueColumn\, \ValueMetaData\, \ValueToStatement\). The implementation also adds \ImplicitResolver\ for resolving typeclass instances and \Inspect\ for discovering sealed trait subclasses, enabling Anorm to function correctly on Scala 3.
core/src/main/scala-3/anorm/macros · high confidence
Add pretty string representation for SQL query tokens
The tokenizer now includes a \Show\ typeclass and specific implementations for \StatementToken\ and \TokenGroup\, enabling a human-readable string representation of internal SQL query structures. This allows users to inspect the formatted state of prepared tokens and placeholders, facilitating debugging and clearer logging of how queries are tokenized before execution.
tokenizer/src/main/scala · high confidence
Added Scala 3 tokenizer implementation for SQL statement parsing
A new Scala 3-specific implementation of the SQL statement tokenizer has been added to the anorm package. This introduces a \TokenizedStatement\ case class and a macro-based \stringInterpolation\ method that parses SQL strings with placeholders at compile time, enabling type-safe parameter binding for Scala 3 users.
tokenizer/src/main/scala-3 · high confidence
Initial release of Anorm core library
This change introduces the core Anorm library for Scala, providing a complete SQL execution and result parsing API. It includes the main entry points for building and executing SQL queries (SimpleSql, BatchSql), a type-safe column mapping system (Column, ParameterMetaData), and a parser combinator library for transforming result sets into case classes or tuples (RowParser, ResultSetParser). The release also adds support for Java 8 time types, URI/URL parameters, and configurable column naming strategies for macro-based case class mapping.
core/src/main/scala · high confidence
New Akka Stream integration for reactive SQL queries
Anorm now provides an Akka Stream module that allows executing SQL queries as reactive sources. This enables users to stream database results directly into Akka Streams pipelines, with the materialized value representing the total number of rows read upon completion. The implementation handles connection and result set lifecycle management automatically, failing the materialized future if row parsing errors occur or if the downstream consumer finishes early.
akka/src/main · high confidence
Removals
Removal of internal Anorm and parser-combinator source files
The internal implementation files for the Anorm SQL library and the Scala parser combinators have been removed from the source tree. This includes the deletion of core Anorm components such as Anorm.scala, Parsers.scala, Reader.scala, SqlParser.scala, SqlStatementParser.scala, TypeWrangler.scala, Utils.scala, and the magic package files (Magic10.scala through Magic13.scala). These files contained the previous inline definitions for SQL parsing, row mapping, type conversion, and parser combinator logic, which are no longer part of this codebase.
src/main · high confidence
Behavioural changes
Build system upgraded to sbt 2.0.8 with Scala 3 support and baseline Java 17
The project build has been upgraded to sbt 2.0.8, enabling compilation against Scala 3.3.8 alongside Scala 2.13.18. The build now enforces a baseline of Java 17 for both Scala 2.13 and Scala 3 targets. Additionally, the build configuration introduces new sbt plugins including sbt-scaladoc-compiler, updates sbt-assembly to 2.5.0, and refactors internal build logic to generate function adapters and manage POM dependencies for publishing.
project · high confidence
Joda-Time support moved to a separate module
Support for Joda-Time types (DateTime, Instant, LocalDate, LocalDateTime) has been extracted from the core library into a dedicated \joda\ module. Users who rely on these types for parsing SQL columns or setting statement parameters must now explicitly import the new \JodaColumn\ and \JodaToStatement\ traits to access the implicit conversions.
joda · high confidence
Refactored Scala 2 macros for case classes, sealed traits, and value classes
The Scala 2 macro implementation in \anorm.macros\ has been restructured to improve support for optional fields, value classes, and sealed traits. New internal components (\Implicit\, \ImplicitResolver\, \Inspect\) centralize implicit resolution and type inspection, allowing \RowParserImpl\ and \SealedRowParserImpl\ to better handle self-referential types and discriminated unions. Additionally, \ToParameterListImpl\ now supports parameter projections for case classes, and dedicated implementations (\ValueColumnImpl\, \ValueMetaDataImpl\, \ValueToStatementImpl\) ensure that value classes correctly delegate to their underlying types for SQL mapping and statement setting.
core/src/main/scala-2/anorm/macros · high confidence
Scala 2-specific macro and compatibility layer for anorm
This change introduces Scala 2-specific implementation files (Macro.scala, PackageCompat.scala, SqlQueryCompat.scala, and package.scala) into the core/src/main/scala-2/anorm directory. These files provide the macro-based row parser generation (namedParser, parser, sealedParser) and SQL string interpolation support required for Scala 2 compilation. This separates Scala 2 macro logic from Scala 3 compatible code, enabling the library to support both Scala versions by providing version-specific implementations.
core/src/main/scala-2/anorm · high confidence
Scala 2-specific tokenization implementation for Anorm statements
Added a Scala 2-specific implementation of the \TokenizedStatement\ class and its associated macro-based tokenizer in the \scala-2\ source directory. This change introduces the \stringInterpolation\ macro and \tokenizeImpl\ logic required to parse SQL statement tokens and bind parameters for Scala 2 users, supporting the project's multi-version compatibility strategy.
tokenizer/src/main/scala-2 · high confidence
Scala 3-specific macro and SQL implementation added
The anorm library now includes a dedicated Scala 3 implementation in the \core/src/main/scala-3/anorm\ directory, providing Scala 3-specific versions of the core SQL query handling and macro-based row parsers. This adds \Macro.scala\ with inline macros for generating \RowParser\ instances for case classes and sealed families, \SqlQueryCompat.scala\ for Scala 3-compatible SQL query execution methods, and \package.scala\ to expose the \SQL\ string interpolation and top-level definitions, ensuring the library functions correctly on the Scala 3 platform.
core/src/main/scala-3/anorm · high confidence
Test coverage
Added comprehensive test suite for Anorm core functionality; Added tests for Akka Stream integration in Anorm; Added tests for PostgreSQL JSONB and UUID support.
Dependencies
Update core dependencies and drop Scala 2.12 support
This release updates several key dependencies, including specs2 to 4.23.0, H2 to 2.5.250, PostgreSQL JDBC to 42.7.13, and scala-parser-combinators to 2.5.0 (for Scala 3). It also drops support for Scala 2.12, requiring users to upgrade to Scala 2.13 or 3, and removes the deprecated scala-arm library in favor of internal resource management.
(dependencies) · high confidence
Housekeeping
Repository initialization and configuration scaffolding
The repository has been initialized with essential configuration files, including \.gitignore\ to exclude build artifacts and \.scalafmt.conf\ to enforce code formatting standards (version 3.11.5, Scala 2.13). A \.git-blame-ignore-revs\ file is added to ignore historical reformatting commits, and a \.scalafix.conf\ is introduced to manage import organization. Documentation scaffolding is also present, with \README.md\ and migration/highlights guides for versions 2.4 through 2.7, alongside a dynamic versioning script (\version.sbt\) and an Apache 2.0 license file.
(repo-wide) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 61.
Lenses
- Code Health 91
- Architecture 99
- Maturity 47
- Readiness 80
- Security 60
Changes since last survey
- 300 commits — 281 feature/other, 19 fixes
By area
- (root) — 121 commits
- project/plugins.sbt — 50 commits
- project/build.properties — 33 commits
- .github/workflows — 25 commits
- core/src — 25 commits
- project/Common.scala — 20 commits
- .github/scala-steward.conf — 3 commits
- akka/src — 3 commits
- docs/manual — 3 commits
- project/Publish.scala — 3 commits
- project/Scapegoat.scala — 3 commits
- enumeratum/src — 2 commits
- (repo) — 1 commit
- .circleci/config.yml — 1 commit
- .devcontainer/devcontainer.json — 1 commit
- .github/PULL_REQUEST_TEMPLATE.md — 1 commit
- .github/dependabot.yml — 1 commit
- .github/mergify.yml — 1 commit
- .github/renovate.json — 1 commit
- pekko/src — 1 commit
Notable commits
- fix: Fix #457 - Handle SQL initialization error in Akka (#463)
- fix: Fix #560: UnexpectedNullableFound incorrectly mapped to ColumnNotFound in parseColumn
- fix: Fix #568 - Scala 3 workaround for pattern matching on generic type ~ (#569)
- fix: Fix GHA workflows
- fix: Fix Dependency Graph action
- fix: Fix deprecated ColumnNotFound constructor call
- fix: Fix documentation link
- fix: Fix revision numbers to ignore reformat
- fix: Fix scalafix import ordering errors in test files
- fix: Partly revert 767c21e8a5ec4f34ab7f6b90a0e827d33b05f5b0
- fix: Revert "Remove version.sbt to avoid confusion, usually that's where we hardcode the version"
- fix: Revert "sbt-scalafix 0.14.7 (was 0.14.6) (#717)" (#719)
- fix: Revert "📦 ci(release-draft): temporarily remove name as it generates an error"
- fix: Revert "📦 ci: fix release-drafter config reference" and "Bump release-drafter/release-drafter from 6 to 7 (#686)"
- fix: fix imports
- fix: revert Scala 3 version to LTS
- fix: 🐛 fix: preserve nanosecond precision in Column[LocalDateTime] (#525) (#714)
- fix: 🐛 fix: revert scala parser combinator to 1.x for Scala 2
- fix: 📦 ci: fix release-drafter config reference
- change: (Re) add compiler flags
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
playframework/anorm was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 16f92598c53b326b1da9ceae9655ae208a3934ca — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.