zio-protoquill icon indicating copy to clipboard operation
zio-protoquill copied to clipboard

org.postgresql.util.PSQLException: ERROR: could not determine data type of parameter $1

Open johannegger opened this issue 1 year ago • 1 comments

Version: (e.g. 4.6.0.1) Module: (e.g. quill-jdbc) Database: (e.g. postgresql)

Expected behavior

I have a table with a column of type nullable uuid (i map postgres uuid -> java.util.UUID) inserting of rows works as expected but filtering by this field when it's empty results in this error:

org.postgresql.util.PSQLException: ERROR: could not determine data type of parameter $1

calling translate and executing the resulting query from the command-line works just fine.

I created this snippet but as since the problem is related to the jdbc driver it's not happening there.

Workaround

using String instead of java.util.UUID works

@getquill/maintainers

johannegger avatar May 04 '23 14:05 johannegger

add code like this, it has a doc: https://zio.dev/zio-quill/extending-quill

import ctx._
import java.util.UUID

implicit val encodeUUID = MappedEncoding[UUID, String](_.toString)
implicit val decodeUUID = MappedEncoding[String, UUID](UUID.fromString(_))

timzaak avatar Dec 08 '23 15:12 timzaak