question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doobe Psql module integration

See original GitHub issue

Very similar issue to #227 . If you use DoobieEnum with postgres enum types, you get errors like: "org.postgresql.util.PSQLException: ERROR: column "shirt" is of type shirtsize but expression is of type character varying"

In order to work with postgres enums in doobie, you need to provide the name of the type you have created. E.g. if you have CREATE TYPE shirt_size AS ENUM ('small', 'medium', 'large');, then you need to create a doobie meta instance like so: implicit val meta: Meta[ShirtSize] = pgEnumString("shirt_size", withName(_), _.entryName).

If enumeratum-doobie was going to include such an instance for the user, you would probably have to add def enumTypeName: String as an implementation detail for the user in DoobieEnum. Maybe instead a new mixin called DoobieStrictEnum could be added that provides this functionality? Happy to work on a PR for this and add a section to the readme, if there is interest for this.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jbwheatleycommented, Mar 14, 2021

Actually I came to the same realization yesterday when I started having a closer look at this 😁

I don’t think (2) is that worthwhile unless there was substantially more that could be pulled out into its own package - its really only 2 lines.

I think (1) is fine. I’ll submit a PR to update the readme.

0reactions
lloydmetacommented, Jul 4, 2021

Hi guys. Just curious – any progress on this issue? I also faced this issue in my project some time ago and came up with a similar solution eventually. But it would be nice if I could use some common solution instead of our custom one.

At this point, the issue is to add a section to the readme to document the Doobie + Psql mix in. There are no plans to add a Psql-specific integration, if that’s your question.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extensions for PostgreSQL · doobie - tpolecat
doobie provides mappings for the top-level PostGIS geometric types provided by the org.postgis driver extension. Mappings for postgis are provided in the ...
Read more >
Appendix F. Additional Supplied Modules - PostgreSQL
This appendix contains information regarding the modules that can be found in the contrib directory of the PostgreSQL distribution.
Read more >
Quill
Free/Libre Compile-time Language Integrated Queries for Scala. ... The quill-jdbc-monix module integrates the Monix asynchronous programming framework with ...
Read more >
node-postgres: Welcome
js modules for interfacing with your PostgreSQL database. It has support for callbacks, promises, async/await, connection pooling, prepared statements, cursors, ...
Read more >
Setting Up Database Monitoring for self hosted Postgres
Install the Agent. Before you begin. Supported PostgreSQL versions: 9.6, 10, 11, 12, 13, 14; Prerequisites: Postgres additional supplied modules ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found