Skip to content

Commit

Permalink
make default implicits available via the same package
Browse files Browse the repository at this point in the history
  • Loading branch information
salamonpavel committed Jul 11, 2024
1 parent b02ef12 commit 4f516ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ package object implicits {

private implicit val showPgArray: Show[PgArray] = Show.fromToString

implicit val jsonPut: Put[Json] = doobie.postgres.circe.json.implicits.jsonPut
implicit val jsonbPut: Put[Json] = doobie.postgres.circe.jsonb.implicits.jsonbPut

implicit val jsonGet: Get[Json] = doobie.postgres.circe.json.implicits.jsonGet
implicit val jsonbGet: Get[Json] = doobie.postgres.circe.jsonb.implicits.jsonbGet

implicit val jsonArrayPut: Put[List[Json]] = {
Put.Advanced
.other[PGobject](
Expand Down
16 changes: 3 additions & 13 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ object Dependencies {
}

def doobieDependencies(scalaVersion: String): Seq[ModuleID] = {
commonDependencies(scalaVersion) ++ jsonSerdeDependencies ++ Seq(
commonDependencies(scalaVersion) ++ Seq(
"org.tpolecat" %% "doobie-core" % "1.0.0-RC2",
"org.tpolecat" %% "doobie-hikari" % "1.0.0-RC2",
"org.tpolecat" %% "doobie-postgres" % "1.0.0-RC2"
"org.tpolecat" %% "doobie-postgres" % "1.0.0-RC2",
"org.tpolecat" %% "doobie-postgres-circe" % "1.0.0-RC2"
)
}

Expand All @@ -57,15 +58,4 @@ object Dependencies {
Seq(postgresql)
}

private def jsonSerdeDependencies: Seq[ModuleID] = {
lazy val circeCore = "io.circe" %% "circe-core" % "0.14.7"
lazy val circeParser = "io.circe" %% "circe-parser" % "0.14.7"
lazy val circeGeneric = "io.circe" %% "circe-generic" % "0.14.7"

Seq(
circeCore,
circeParser,
circeGeneric,
)
}
}

0 comments on commit 4f516ab

Please sign in to comment.