Installation

Prerequisites

  • PostgreSQL with the PGMQ extension installed
  • Scala 3 (3.3.x LTS or newer)

Dependencies

Pick one database backend and one JSON codec. The backend pulls in pgmq4s-core transitively — no need to add it yourself.

SBT

libraryDependencies ++= Seq(
  "io.github.matejcerny" %% "pgmq4s-doobie" % "0.8.0",  // backend
  "io.github.matejcerny" %% "pgmq4s-circe"  % "0.8.0"   // JSON codec
)

Scala CLI

//> using dep io.github.matejcerny::pgmq4s-doobie:0.8.0
//> using dep io.github.matejcerny::pgmq4s-circe:0.8.0

Mill

def ivyDeps = Agg(
  ivy"io.github.matejcerny::pgmq4s-doobie:0.8.0",
  ivy"io.github.matejcerny::pgmq4s-circe:0.8.0"
)

Scala.js and Scala Native

For cross-platform projects, use %%% (SBT) or ::: (Mill) instead of %%/:: and pick only the modules that support your platform:

// SBT
libraryDependencies ++= Seq(
  "io.github.matejcerny" %%% "pgmq4s-skunk" % "0.8.0",
  "io.github.matejcerny" %%% "pgmq4s-circe" % "0.8.0"
)
Warning

Play JSON, Spray JSON, Anorm, Doobie, and Slick are JVM-only. Only Skunk and the cross-platform codec modules (Circe, Jsoniter, uPickle) are available on JS and Native.

Available Artifacts

Artifact Description Platforms
pgmq4s-core Core types and algebra JVM, JS, Native
pgmq4s-circe Circe JSON codec bridge JVM, JS, Native
pgmq4s-jsoniter Jsoniter-scala JSON codec bridge JVM, JS, Native
pgmq4s-upickle uPickle JSON codec bridge JVM, JS, Native
pgmq4s-play-json Play JSON codec bridge JVM only
pgmq4s-spray-json Spray JSON codec bridge JVM only
pgmq4s-skunk Skunk backend JVM, JS, Native
pgmq4s-doobie Doobie backend JVM only
pgmq4s-anorm Anorm backend JVM only
pgmq4s-slick Slick backend JVM only