khibino / haskell-relational-record

This repository includes a joined query generator based on typefull relational algebra, and mapping tools between SQL values list and Haskell record type.
233 stars 36 forks source link

Support for ZonedTime and UTCTime #36

Closed bssstudio closed 8 years ago

bssstudio commented 8 years ago

This PR adds the TIMEZONETZ keyword and adds appropriate instances for haskell time types ZonedTime and UTCTime.

bssstudio commented 8 years ago

Does not build because the relational-query needs the stuff changed in sql-words package.

khibino commented 8 years ago

I think this fix has a problem. UTCTime values are always expanded into TIMESTAMPTZ literal. TIMESTAMPTZ literal is NOT standard in SQL.

Adding instance of ZonedTime type is acceptable. How about this?

bssstudio commented 8 years ago

If ZonedTime instances were added, that would be sufficient, as UTCTime can be converted into ZonedTime (datetime+0000).

Would ZonedTime still be expanded into TIMESTAMPTZ?

khibino commented 8 years ago

Merged. I think about this fix for a while, and I can accept this with additional comment about UTCTime instance.