mauricio / postgresql-async

Async, Netty based, database drivers for PostgreSQL and MySQL written in Scala
Apache License 2.0
1.43k stars 222 forks source link

Microsecond precision #219

Open zifeo opened 7 years ago

zifeo commented 7 years ago

When working with sql type DATETIME(6), how can we keep microsecond precision and avoid joda time millisecond restriction?

mirabout commented 7 years ago

Just cast the desired Sql result column to an integer of an appropriate size and expect an integer object on the user side.

mirabout commented 7 years ago

In general, you can decompose a date in Sql query and return the date as a list of separated integer columns if you want to bypass joda time representation.