Misleading import paths for Json/Jsonb stuff in doobie-postgres-circe module
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 2.2k
- Forks
- 379
- Avg merge
- 14m
- Merged PRs (30d)
- 8
Description
The current imports are:
import doobie.postgres.circe.json.implicits.* // for Json
import doobie.postgres.circe.jsonb.implicits.* // for Jsonb
In fact, the only implicits they bring in are Get[Json] and Put[Json] instances.
However, those paths seem the only way to import instance constructors: pgEncoderPut* and pgDecoderGet* which are not implicit and have to be called explicitly in order to create instances for specific types.
Importing ..implicits.* in order to access non-implicit stuff is really misleading and can be confusing.
Perhaps it makes sense to deprecate .implicits and provide alternative import path .instances, i.e.:
import doobie.postgres.circe.json.instances.* // for Json
import doobie.postgres.circe.jsonb.instances.* // for Jsonb
By convention, instances imply "typeclass instances" and are usually implicits as well, but providing non-implicit instance constructors along with instances themselves should be fine.
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
Review the doobie-postgres-circe module's json and jsonb import definitions and their uses; start by checking how implicits.* exposes Get/Put instances and pgEncoderPut*/pgDecoderGet* constructors. Confirm the intended compatibility and naming policy, then verify that replacement import paths and deprecation behavior are covered by the module's existing tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, scala
- Domain
- databases
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100