-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract Epoch #291
Comments
This hasn't been implemented in Opaleye. It could be implemented in a similar way to the existing functions in https://github.com/tomjaguarpaw/haskell-opaleye/blob/master/src/Opaleye/Operators.hs |
So how can I implement them? Is there an example somewhere? Thanks. |
Answering my own question: I did it like this:
|
Great! Isn't it slightly nicer to do epoch :: Column LocalTime -> Column Int
epoch = Col.Column . extract . epoch' . unColumn
where
extract a = HPQ.FunExpr "extract" [a]
epoch' a = HPQ.FunExpr "epoch from" [a]
unColumn (Column a) = a Would you be able to submit this as a PR? |
This seems resolved. Feel free to reopen if not. |
Hi everyone, I'm just wondering how to get Postgres functions in Opaleye, in particular how can I get the following?
Thanks in advance.
The text was updated successfully, but these errors were encountered: