Closed useronym closed 5 years ago
You only need to use the func
function to define custom functions - it takes any number of arguments - they just have to be convertable to Expr
.
date_part
is actually an example in the func
docs: https://github.com/m4dc4p/haskelldb/blob/master/src/Database/HaskellDB/Query.hs#L565.
However, I'm glad to merge the <>
changes, if you'd like to update this PR.
Alright I see, thanks! I removed the commit.
We define our own instance of
Args
for use with the PSQL functiondate_part
:Then, we can use it like so in projections:
There might be a better way to achieve this, I'm not sure. I'm not terribly fluent with haskelldb, but I was migrating a project from GHC 6.12 to 8.4.4 and it seems at some point
arg_
became private, thus breaking our code.