Open potomak opened 8 years ago
Thanks for the PR!
|
and ~
operators as well./Since: 2.4.2/
to the Haddocks of the new operators.I'm adding |
and ~
. To support ~
I'm creating an helper function unsafeSqlUnOp
, similar to unsafeSqlBinOp
.
I added |
, ~
, and unsafeSqlUnOp
. Do you think it would be fine to implement the NOT
operator in terms of unsafeSqlUnOp
?
Hmm, the bitwise not will have to be used as (~.) foo
, right? I haven't tried but I don't think ~. foo
will work. Can you rename it to bitwiseNot
to avoid confusion?
Yeah, implementing not_
with unsafeSqlUnOp
would be fine! We'll lose the more specific error, but who's not_
ing a primary key anyway? :)
Yes, I don't think ~. foo
would work and I had the same concern about the usage as (~.) foo
. The bitwiseNot
function name makes more sense even if it's not consistent with all the other bitwise operators.
I will
(~.)
to bitwiseNot
;not_
with unsafeSqlUnOp
.
See also http://www.postgresql.org/docs/9.4/static/functions-math.html.