Add support for range operators (#938)

This commit is contained in:
Russell Davies
2017-08-20 09:45:27 -05:00
committed by Joe Nelson
parent c72bc37630
commit 59a320fd44
8 changed files with 116 additions and 18 deletions
+2
View File
@@ -417,7 +417,9 @@ pgFmtFilter table (Filter fld (Operation hasNot_ ex)) = notOp <> " " <> case ex
(op, VText val) -> pgFmtFieldOp op <> " " <> case op of
"like" -> unknownLiteral (T.map star val)
"ilike" -> unknownLiteral (T.map star val)
-- TODO: The '@@' was deprecated, remove in v0.5.0.0
"@@" -> "to_tsquery(" <> unknownLiteral val <> ") "
"fts" -> "to_tsquery(" <> unknownLiteral val <> ") "
"is" -> whiteList val
"isnot" -> whiteList val
_ -> unknownLiteral val
+10
View File
@@ -161,6 +161,16 @@ operators = M.fromList [
("notin", "NOT IN"),
("isnot", "IS NOT"),
("is", "IS"),
("fts", "@@"),
("cs", "@>"),
("cd", "<@"),
("ov", "&&"),
("sl", "<<"),
("sr", ">>"),
("nxr", "&<"),
("nxl", "&>"),
("adj", "-|-"),
-- TODO: these are deprecated and should be removed in v0.5.0.0
("@@", "@@"),
("@>", "@>"),
("<@", "<@")]