feat: Allow filtering by IS DISTINCT FROM using the isdistinct operator

This commit is contained in:
Laurence Isla
2023-04-06 13:02:03 -05:00
committed by GitHub
parent acf62320ef
commit d3b10e7b2a
7 changed files with 28 additions and 1 deletions
+3 -1
View File
@@ -589,11 +589,13 @@ pOpExpr pSVal = do
OpExpr boolExpr <$> pOperation
where
pOperation :: Parser Operation
pOperation = pIn <|> pIs <|> try pFts <|> try pOp <?> "operator (eq, gt, ...)"
pOperation = pIn <|> pIs <|> pIsDist <|> try pFts <|> try pOp <?> "operator (eq, gt, ...)"
pIn = In <$> (try (string "in" *> pDelimiter) *> pListVal)
pIs = Is <$> (try (string "is" *> pDelimiter) *> pTriVal)
pIsDist = IsDistinctFrom <$> (try (string "isdistinct" *> pDelimiter) *> pSVal)
pOp = do
opStr <- try (P.manyTill anyChar (try pDelimiter))
op <- parseMaybe ("unknown single value operator " <> opStr) . operator $ toS opStr