valderman / selda

A type-safe, high-level SQL library for Haskell
https://selda.link
MIT License
478 stars 58 forks source link

Support plain timestamp type (oid 1114) #151

Open kayhide opened 3 years ago

kayhide commented 3 years ago

Support plain timestamp type (timestamp without timezone) which is mapped to oid of 1114.

Currently it has timestampType and is mapped to oid 1184 as: https://github.com/valderman/selda/blob/33f76cf7f21f73c82365aaf959ec69195d1bcd89/selda-postgresql/src/Database/Selda/PostgreSQL/Encoding.hs#L30-L47

Plain timestamp type is necessary when reading a table which is created by some other library/framework.

kayhide commented 3 years ago

On our application, we make all timestamps to be saved in utc and use only oid 1114. In such a case, just replacing the 1184 with 1114 works.

But of course, it is not a good solution as a library...