Skip to content
CAI
Software that uses CAICheck a score

tminglei/slick-pg

59.2

Adequate · 28 September 2026

6.2k

lines of production code

Scala

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a Scala library that extends Slick to provide comprehensive support for PostgreSQL-specific data types and operations. It enables developers to map complex database structures—including JSON/JSONB, PostGIS geography, arrays, HStore, ranges, and enums—directly to Scala types using various serialization libraries. Additionally, it exposes native PostgreSQL capabilities such as full-text search, window functions, and bulk upserts within the Slick query API.

How it got here

2013–2014 — PostgreSQL type and extension expansion

20 changes.

This period focused on significantly expanding Slick-PG's support for PostgreSQL-specific data types and features, including arrays, dates, JSON, HStore, PostGIS, and full-text search. The work involved adding comprehensive Scala extension methods and JDBC type mappings for these complex types, alongside new addons for JSON libraries like JSON4s and Argonaut. Dependency updates were also performed to ensure compatibility with newer Scala versions and underlying libraries.

2015–2016 — PostgreSQL feature expansion and test coverage

19 changes.

This period focused on expanding Slick-PG's capabilities by adding support for PostgreSQL window functions, aggregate functions, large object streaming, and various JSON libraries like Circe and Json4s. The work was heavily supported by the creation of comprehensive test suites to validate these new features, including PostGIS integration, date/time handling, and string operations.

2017–2023 — PostGIS, JSON, and Scala 3 support

11 changes.

This period focused on expanding Slick-PG's capabilities by adding support for PostgreSQL's pg\_trgm, PostGIS geography types, and multiple JSON libraries (Jawn, uPickle). It also involved implementing composite type handling and establishing full Scala 3 compatibility with corresponding test suites.

Features

Add Argonaut JSON support addon

Users can now use the Argonaut library for JSON handling in Slick PostgreSQL. This new addon module provides implicit type mappers and column extension methods to map PostgreSQL JSON/JSONB columns to Argonaut's Json type, including support for plain SQL queries and code generation binding.

addons/argonaut/src/main · high confidence

Add Circe JSON support for Slick

Introduces a new \PgCirceJsonSupport\ trait that enables mapping PostgreSQL \json\ and \jsonb\ columns to Circe's \Json\ type. This allows users to interact with JSON data using Circe's parsing and serialization APIs, including support for both \Json\ and \Option\[Json\]\ column types, with null values defaulting to \Json.Null\ and output formatted as compact JSON.

addons/circe-json/src/main · high confidence

Add JSON4s support for Slick PostgreSQL

Introduces a new PgJson4sSupport trait that enables seamless integration with the JSON4s library for handling JSON and JSONB columns in PostgreSQL. This addition provides implicit type mappers for JValue, allowing Slick to automatically parse and render JSON data using JSON4s, and includes extension methods for convenient column operations as well as plain SQL support for reading and writing JSON values.

addons/json4s/src/main, addons/play-json/src/main · high confidence

Add Jawn-based JSON support for PostgreSQL

Introduces a new \PgJawnJsonSupport\ trait that enables JSON and JSONB column handling in Slick using the Jawn parsing library. This allows users to map PostgreSQL JSON/JSONB fields to Jawn's \JValue\ type, providing implicit JDBC type mappings and column extension methods for both standard and plain SQL queries.

addons/jawn/src/main · high confidence

Add PostgreSQL array extension methods and JDBC types

This change introduces new Scala traits in the Slick-PG core module to support PostgreSQL array operations. It adds \PgArrayExtensions\, which provides extension methods for array columns allowing users to perform SQL operations such as containment (\@\>\), overlap (\@&\), concatenation (\++\, \+\, \+:\), and functions like \length\ and \unnest\ directly in Slick queries. It also adds \PgArrayJdbcTypes\, defining \SimpleArrayJdbcType\ and \AdvancedArrayJdbcType\ to handle the mapping of PostgreSQL arrays to Scala sequences, including support for native PostgreSQL array creation for primitive types and static type checking for built-in supported element types.

core/src/main/scala/com/github/tminglei/slickpg/array · high confidence

Add PostgreSQL string and binary encoding extensions

Users can now perform case-insensitive pattern matching (ilike) and POSIX regular expression matching (\~, \~\, !\~, !\~\) directly in Slick queries, as well as convert and encode/decode binary data using PostgreSQL's built-in functions (convert, convert\_from, convert\_to, encode, decode).

core/src/main/scala/com/github/tminglei/slickpg/str · high confidence

Add Scala 2 support for PostgreSQL composite types

Users can now map PostgreSQL composite types to Scala case classes in Scala 2 builds. This change introduces the \PgCompositeSupport\ trait and associated utilities (including \TypeConverters\ and \PgCompositeSupportUtils\) that handle serialization and deserialization of composite structures, arrays, and options, enabling seamless integration of complex Postgres types with Slick.

core/src/main/scala-2, src/main/scala-2 · high confidence

Add Scala 3 composite type support

Added PgCompositeSupport.scala in the Scala 3 source directory to enable composite type handling for Scala 3 projects. This new file provides inline methods and utilities for converting between Scala case classes (specifically those extending Struct) and PostgreSQL composite types, leveraging Scala 3's metaprogramming features like Mirror and summonInline for automatic derivation.

src/main/scala-3 · high confidence

Add Scala 3-specific type conversion utilities and stubbed composite support

This change introduces Scala 3-specific implementations for the Slick-PG core. It adds a \TypeConverters\ utility that registers implicit converters for mapping between strings and common Scala/Java types (including \Int\, \Long\, \UUID\, \Date\, \LocalDate\, \LocalDateTime\, etc.), enabling type handling in Scala 3 builds. Additionally, it adds a stubbed \PgCompositeExtensions\ trait and a \Struct\ marker for Scala 3, noting that composite type support is not yet fully implemented.

core/src/main/scala-3 · high confidence

Add Slick extensions for PostgreSQL HStore operations

This change introduces the \PgHStoreExtensions\ trait, which provides a set of Slick column extension methods for interacting with PostgreSQL's HStore data type. Users can now perform HStore-specific operations directly in their queries, including retrieving values by key (\+\>\, \\>\>\), checking for key existence (\??\, \?\*\[defined\]\, \?\|\[any\]\, \?&\[all\]\), containment checks (\@\>\, \\<@:\), and modification operations like concatenation (\@+\) and deletion (\@-\, \--\, \-/\). A corresponding README documents these supported operators and their PostgreSQL equivalents.

core/src/main/scala/com/github/tminglei/slickpg/hstore · high confidence

Add Spray JSON support for PostgreSQL JSON/JSONB columns

The new \PgSprayJsonSupport\ trait enables seamless integration with the Spray JSON library, allowing Slick users to map PostgreSQL \json\ and \jsonb\ columns directly to \JsValue\ types. This addition provides implicit type mappers and column extension methods for both standard and optional JSON fields, as well as support for plain SQL queries, simplifying the handling of JSON data in PostgreSQL databases.

addons/spray-json/src/main · high confidence

Add code generation customization example project

A new example project has been added to demonstrate how to customize the Slick code generator. It includes a custom PostgreSQL driver extending ExPostgresProfile with support for arrays, dates, enums, ranges, HStore, search, and PostGIS, along with a generator that maps specific database types (such as hstore, text arrays, and geometry) to Scala types like Map, List, and JTS Geometry, and outputs the generated tables to a specified file.

examples/codegen-customization/codegen · high confidence

Add example for customizing Slick code generation

Added a new example project in \examples/codegen-customization\ that demonstrates how to configure sbt to use a customized Slick code generator for an existing database schema. The example includes a Docker Compose setup for a PostgreSQL database, SQL scripts to create and populate tables, and Scala code showing how to define a custom generator and use the resulting models.

examples/codegen-customization · high confidence

Add pg\_trgm support with similarity operators and functions

New files in the trgm module introduce support for PostgreSQL's pg\_trgm extension, exposing trigram similarity operators (%, \<% , %\>, \<\<%, %\>\>, \<-\>, \<\<-\>, \<-\>\>, \<\<\<-\>, \<-\>\>\>) and functions (similarity, word\_similarity, strict\_word\_similarity) as Slick extension methods on string columns. This allows users to perform fuzzy string matching and similarity scoring directly in their queries.

core/src/main/scala/com/github/tminglei/slickpg/trgm · high confidence

Add support for PostGIS geography types via JTS library

This change introduces support for PostgreSQL's geography data type by integrating the LocationTech JTS library. It adds new Scala/Java classes (PgGeographyTypes and PgPostGISSupport) that define JTS-based geometry and geography types (such as GeogPoint, GeogPolygon, etc.) and register corresponding JDBC type mappers. Users can now map and query PostGIS geography columns in their Slick models, with the implementation handling serialization/deserialization via WKB/WKT formats using the JTS factory.

_addons/jts\lt/src/main · high confidence

Add support for PostgreSQL arrays, dates, enums, hstore, JSON, ltree, network types, and ranges

This change introduces a comprehensive set of new type mappers and column extension methods for PostgreSQL-specific data types, enabling seamless mapping between Scala types and PostgreSQL columns. Specifically, it adds support for simple arrays (UUID, String, numeric, boolean, date/time types), Java 8 date/time types (LocalDate, LocalTime, LocalDateTime, Instant, OffsetDateTime, ZonedDateTime) and periods/durations, PostgreSQL enums, hstore key-value maps, JSON/JSONB strings, ltree hierarchical paths, network addresses (inet, macaddr), and numeric/date/time ranges. These features are provided through dedicated support traits (PgArraySupport, PgDate2Support, PgEnumSupport, PgHStoreSupport, PgJsonSupport, PgLTreeSupport, PgNetSupport, PgRangeSupport) that integrate with the Slick Postgres profile, allowing users to query and update these complex types directly in their Slick database operations.

src/main/scala · high confidence

Add support for PostgreSQL geography types

This change introduces support for PostgreSQL's geography data type alongside the existing geometry support. It adds new JTS-based classes (such as GeogPoint, GeogPolygon, etc.) and corresponding JDBC type mappers, allowing users to store and query geographic coordinates with proper distance and area calculations in PostGIS.

addons/jts/src/main · high confidence

Add support for PostgreSQL network types (inet, macaddr)

Users can now query and manipulate PostgreSQL network data types (inet and macaddr) using Slick. This change introduces PgNetExtensions, which provide Scala methods for PostgreSQL network operators (such as containment checks like \<\<, \>\>, &&) and functions (like host, broadcast, masklen, and trunc) on inet and macaddr columns.

core/src/main/scala/com/github/tminglei/slickpg/net · high confidence

Add support for PostgreSQL range operators and functions

Users can now perform set operations and comparisons on PostgreSQL range columns directly within Slick queries. This change introduces extension methods for range types, enabling the use of operators such as contains (@\>), contained by (\<@), overlap (@&), union (+), intersection (\*), and subtraction (-), as well as functions to retrieve the lower and upper bounds of a range.

core/src/main/scala/com/github/tminglei/slickpg/ltree, core/src/main/scala/com/github/tminglei/slickpg/range · high confidence

Add support for PostgreSQL window functions

This change introduces a new \window\ module that enables the use of PostgreSQL window functions within Slick queries. Users can now apply functions such as \rowNumber\, \rank\, \denseRank\, \lag\, and \lead\ to aggregated data, specifying partitioning, ordering, and frame definitions (rows or range) via a fluent API. The implementation includes the necessary Slick AST nodes and SQL generation logic to translate these Scala expressions into valid PostgreSQL SQL.

core/src/main/scala/com/github/tminglei/slickpg/window · high confidence

Added PostgreSQL full-text search support with Slick extensions

This change introduces a new \PgSearchExtensions\ module that provides Slick API extensions for PostgreSQL full-text search capabilities. Users can now perform text search operations directly within Slick queries using methods like \tsVector\, \tsQuery\, \toTsVector\, \toTsQuery\, \plainToTsQuery\, \phraseToTsQuery\, and \webSearchToTsQuery\. The module also supports search operators such as \@@\ (matches), \@+\ (concatenate), \@&\ (AND), \@\|\ (OR), \!!\ (negate), and \\<-\>\ (phrase), as well as ranking and headline functions like \tsRank\, \tsRankCD\, and \`tsHeadline. This enables developers to leverage PostgreSQL's native full-text search features through the Slick ORM.

core/src/main/scala/com/github/tminglei/slickpg/search · high confidence

Added support for PostgreSQL enum type operations

This change introduces PgEnumExtensions, enabling users to query PostgreSQL enum types using the enum\_first, enum\_last, and enum\_range functions. Users can now retrieve the first or last value of an enum column, or obtain an ordered array of all enum values or a range between two specific values, directly within Slick queries.

core/src/main/scala/com/github/tminglei/slickpg/enums · high confidence

Expanded PostGIS geometry and geography support with new functions and operators

The PostGIS extension now provides a comprehensive set of Scala wrappers for PostGIS capabilities, including constructors for both geometry and geography types (e.g., \geomFromText\, \geogFromText\), spatial relationship operators (e.g., \&&\, \\~\), accessors (e.g., \ST\_X\, \ST\_SRID\), and output formats (e.g., \ST\_AsGeoJSON\, \ST\_AsEncodedPolyline\). This update also introduces support for geography types, clustering window functions (\ST\_ClusterDBSCAN\, \ST\_ClusterKMeans\), and specific point operations (\ST\_EndPoint\, \ST\_PointN\, \ST\_StartPoint\), enabling more complex spatial queries and data transformations directly within Slick.

core/src/main/scala/com/github/tminglei/slickpg/geom · high confidence

Joda-time addon now supports Instant and configurable timezone formatters

The Joda-time integration for Slick-PG has been expanded to include support for the Joda \Instant\ type, mapping it to PostgreSQL \timestamptz\ columns alongside existing types like \LocalDate\, \LocalTime\, \LocalDateTime\, and \DateTime\. Additionally, the addon now exposes configurable formatters for timezone-aware timestamps, allowing users to customize how \DateTime\ and \Instant\ values are parsed and formatted during database operations. This change also includes refactoring to support multiple type bindings and fixes for parameter literal issues in SQL generation.

addons/joda-time/src/main · high confidence

New JSON and JSONB operators and functions for PostgreSQL

This change introduces a new \PgJsonExtensions\ module that adds support for PostgreSQL JSON and JSONB operations. Users can now use Slick extension methods to access JSON array elements (\\~\>\, \\~\>\>\), object fields (\+\>\, \+\>\>\), and paths (\\#\>\, \\#\>\>\), as well as perform containment checks (\@\>\, \\<@\), existence checks (\??\, \?\|\, \?&\), concatenation (\\|\|\), and deletion (\-\, \\#-\). Additionally, utility functions for inspecting JSON structures (\jsonType\, \objectKeys\, \arrayLength\, \arrayElements\, \arrayElementsText\) and modifying JSONB content (\set\) are now available.

core/src/main/scala/com/github/tminglei/slickpg/json · high confidence

New aggregate function support for PostgreSQL

Added support for a comprehensive set of PostgreSQL aggregate functions, including general-purpose aggregations (such as arrayAgg, stringAgg, avg, sum, count), statistical functions (like corr, covarPop, stddev, variance), ordered-set aggregates (mode, percentileCont, percentileDisc), and hypothetical-set aggregates (rank, denseRank, percentRank, cumeDist). This enables users to perform complex data analysis and ranking operations directly within Slick queries against PostgreSQL databases.

core/src/main/scala/com/github/tminglei/slickpg/agg · high confidence

New date and time extension methods and JDBC type mappings

This change introduces new Scala files in the \core/src/main/scala/com/github/tminglei/slickpg/date\ directory that extend Slick's PostgresProfile with comprehensive date/time support. \PgDateExtensions.scala\ adds extension methods for \TIMESTAMP\, \TIME\, \DATE\, and \INTERVAL\ columns, enabling operations like \age\, \part\, \trunc\, \dateBin\, \isFinite\, and \atTimeZone\, as well as arithmetic operators. \PgDateJdbcTypes.scala\ provides a \GenericDateJdbcType\ that maps Java 8 date/time types (\LocalDate\, \LocalTime\, \LocalDateTime\, \OffsetDateTime\, \Instant\, \Duration\) and \Calendar\ to PostgreSQL types, handling specific conversions like \PGInterval\ to \Duration\. The included README documents these new capabilities.

core/src/main/scala/com/github/tminglei/slickpg/date · high confidence

New uPickle JSON addon for Slick-Postgres

Adds a new \upickle-json\ addon that enables storing and querying JSON/JSONB columns in PostgreSQL using the uPickle library. This introduces \PgUPickleJsonSupport\ traits to map \ujson.Value\ types to database columns, providing both lifted Slick API support (including JSON operators like \+\>\, \\#\>\, \@\>\, and array functions) and plain SQL support for reading and writing JSON data.

addons/upickle-json · high confidence

New utility classes for JSON cleaning, generic JDBC types, token parsing, and array handling

Added four new utility files to the core utils package: JsonUtils to sanitize strings by removing null characters while preserving escaped sequences; PgCommonJdbcTypes providing a GenericJdbcType for flexible string-to-T conversions; PgTokenHelper implementing a tokenizer and parser for PostgreSQL array and composite structures; and PlainSQLUtils and SimpleArrayUtils supporting plain SQL array operations with converters and serialization helpers.

core/src/main/scala/com/github/tminglei/slickpg/utils · high confidence

Play 2.5+ computer database example with Slick and PostgreSQL

The play-slick-example project has been updated to use Play 2.5.1, play-slick 2.0.0, and slick-pg 0.12.1. This introduces a complete computer database management interface, allowing users to list, create, edit, and delete computers along with their associated companies. The application now uses dependency injection for controllers and DAOs, leverages Slick with a custom PostgreSQL driver for database interactions, and includes database evolutions to set up the schema. The UI is styled with Twitter Bootstrap and supports pagination, filtering, and sorting of computer records.

examples/play-slick-example · high confidence

Support for streaming and uploading Postgres Large Objects

Users can now stream Postgres Large Objects from the database using a new \LargeObjectStreamingDBIOAction\ that emits byte chunks via reactive streams, and upload Large Objects by passing an \InputStream\ to \buildLargeObjectUploadAction\. The streaming implementation fixes a bug where emitting empty byte arrays could prematurely terminate the stream, ensuring reliable data transfer for both reads and writes.

core/src/main/scala/com/github/tminglei/slickpg/lobj · high confidence

Behavioural changes

Introduce ExPostgresProfile with native upsert and bulk operations

The library now provides ExPostgresProfile as the primary entry point, deprecating the legacy ExPostgresDriver type. This profile enables native upsert support via the new insertOrUpdateAll method for efficient bulk record insertion and updates, and includes explicit column options for configuring auto-incrementing columns using database sequences.

core/src/main/scala/com/github/tminglei/slickpg · high confidence

Test coverage

Added Scala version-specific test shims for type converter registration; Added comprehensive PostGIS integration tests; Added comprehensive test suite for Json4s JSON support; Added comprehensive test suite for Play JSON support; Added comprehensive test suites for PostgreSQL data type support; Added integration tests for Argonaut JSON support; Added test configuration for TSQL and logging; Added test coverage for Joda-Time date/time support in Slick-PG; Added test suite for PostGIS geometry and geography support; Added test suites for aggregation, window, upsert, and inheritance features; Added tests for Circe JSON support in Slick; Added tests for Jawn JSON support in Slick-PG; Added tests for PostgreSQL string support features; Added tests for Spray JSON support in PostgreSQL; Added tests for large object upload and download; Added tests for pg\_trgm string similarity functions; Added unit tests for utility helpers.

Dependencies

Update core dependencies and add Scala 3 support

The build configuration has been updated to Slick 3.6.1, PostgreSQL JDBC driver 42.7.13, and Play JSON 3.0.6 (for Scala 2.13+ and 3), while adding explicit support for Scala 3 alongside Scala 2.12 and 2.13. Other dependency updates include izumi-reflect 3.0.9, scala-collection-compat 2.14.0, scalatest 3.2.20, and testcontainers-scala 0.44.1.

(dependencies) · 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

Score

  • CAI 58 → 59 (+1.0)
  • Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.

Lenses

  • Code Health 94 → 94 (-0.1)
  • Architecture 90 → 79 (-11.1)
  • Maturity 59 → 59 (+0.0)
  • Readiness 43 → 47 (+4.1)
  • Security 78 → 78 (+0.0)

Resolved (3)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Off-boarding risk: anonymized user #1

New (8)

  • Documentation: no installation or build instructions (core/src/main/scala/com/github/tminglei/slickpg/net/README.md)
  • Documentation: no project overview (core/src/main/scala/com/github/tminglei/slickpg/net/README.md)
  • Documentation: no project overview (core/src/main/scala/com/github/tminglei/slickpg/window/README.md)
  • Documentation: no usage examples (core/src/main/scala/com/github/tminglei/slickpg/net/README.md)
  • Duplicated block (84 lines × 2) (addons/jts/src/main/scala/com/github/tminglei/slickpg/PgGeographyTypes.java)
  • Off-boarding risk: anonymized user #1
  • Outdated: joda-time:joda-time
  • Projects may be oversized for their cohesion

Architecture

  • Containers 0 added · 0 removed · contexts 2 added · 0 removed · edges 1 added · 0 removed

Added bounded contexts (2)

  • play-slick-example
  • repository

Added dependency edges (1)

  • play-slick-example → repository (coupling)

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

tminglei/slick-pg 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 28 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 abd5290a3ae4b05a6a588fe50aa656009b9d2386 — the exact code this score is about.
  • Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-2d9048c36d26.