How to prevent `scalike` from converting `LocalDateTime` to a specific LocalDateTime

133 Views Asked by At

I am using scalike as a simple sql connector.

To retrieve sql.timestamp to LocalDateTime we use wrappedResultSet.localDateTime(1).

Unfortunately, it does add an offset (+1 in my case).

By digging the scalike code, I have seen this is a "feature":

implicit def javaTimeLocalDateTime(implicit z: OverwrittenZoneId): TypeBinder[LocalDateTime] =
    Binders.sqlTimestamp.map(Binders.convertJavaTimeLocalDateTime(z.value))

How could I convert sql.timestamp to LocalDateTime without adding any offset ?

I already tried by overloading the z value without success

implicit val z: OverwrittenZoneId = OverwrittenZoneId(ZoneId.of("UTC"))
0

There are 0 best solutions below