Closed khwarizmii closed 2 years ago
Here's another one:
dateTruncTimestamp :: '[ null 'PGtext, null 'PGtimestamp ] ---> null 'PGtimestamp
dateTruncTimestamp = unsafeFunctionN "date_trunc"
Credit for these goes to @simfleischman !
So while I know the official postgres docs gives the above as the signature for date_trunc
, the text argument can only take on certain values, specified in § 9.9.2 of the postgres docs:
microseconds
milliseconds
second
minute
hour
day
week
month
quarter
year
decade
century
millennium
Perhaps we want a simple sum type for the allowed values?
Being addressed in #284
From working with this library, here are some additions:
(hopefully we can see a PR soon!)