Add doobie-postgres-tethys integration
Open
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 2.2k
- Forks
- 379
- Avg merge
- 14m
- Merged PRs (30d)
- 8
Description
How do you feel about adding a new module with Put and Get instances for json and jsonb for tethys similar to doobie-postgres-circe?
smth like that
trait JsonBTethysInstances {
implicit private val showPGobject: Show[PGobject] = Show.show(_.getValue.take(250))
def jsonbPut[T: JsonWriter]: Put[T] =
Put.Advanced.other[PGobject](
NonEmptyList.of("jsonb")
).tcontramap { a =>
val o = new PGobject
o.setType("jsonb")
o.setValue(a.asJson)
o
}
def jsonbGet[T: JsonReader]: Get[T] =
Get.Advanced.other[PGobject](
NonEmptyList.of("jsonb")
).temap(_.getValue.jsonAs[T].leftMap(_.getMessage))
}
and the similar for "json"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining the existing doobie-postgres-circe module and the Tethys JsonWriter and JsonReader APIs. Add the proposed doobie-postgres-tethys module with Put and Get instances for both json and jsonb, then verify that the integration handles PostgreSQL values as shown in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgres, scala
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100