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

decide on handling of unsupported data types in JDBC (ZonedDateTime, Instant and OffsetTime), UUID in MySQL

Open bertlebee opened this issue 5 years ago • 2 comments

According to https://jdbc.postgresql.org/documentation/head/java8-date-time.html, ZonedDateTime, Instant and OffsetTime are not supported by JDBC. Some databases will likely support these types if we bypass the JDBC driver (everything else is platform specific, why not executor as well :D) . A couple of options:

  1. have some reasonable defaults e.g. Use an instant stored as an integer type or timestamp at UTC, zoned date time might use a timestamp which is always UTC
  2. remove these types from the default type tags and implement them separately as platform specific extensions
  3. allow users to define how they'd like them stored using a typeclass or something?
  4. do something crazy like having two columns (with one to store tz information) accessed as if it's one by zio-sql (I don't think this is a good idea...)

1 and 2 would require good documentation and consistent handling across the types. 3 & 4 are probably unideal...

@jczuchnowski / @jdegoes any thoughts on this?

bertlebee avatar Nov 25 '20 05:11 bertlebee

In #321 @andrewhj pointed out MySQL doesn't support UUID directly, so that's another one we'll have to tackle.

https://github.com/zio/zio-sql/pull/321#issuecomment-733524550

bertlebee avatar Nov 25 '20 07:11 bertlebee

Need more research if the way we're handling it now is correct. Specific tests would be good.

jczuchnowski avatar Feb 23 '22 21:02 jczuchnowski