fix: Stricter query string parsing - no empty casts

Signed-off-by: Wolfgang Walther <walther@technowledgy.de>
This commit is contained in:
Wolfgang Walther
2022-10-27 21:54:44 +02:00
committed by Wolfgang Walther
parent ecf54bef43
commit bbbc308b6f
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -494,13 +494,18 @@ pRelationSelect = lexeme $ try ( do
-- Left (line 1, column 2):
-- unexpected '!'
-- expecting ")", "," or end of input
--
-- >>> P.parse pFieldSelect "" "name::"
-- Left (line 1, column 7):
-- unexpected end of input
-- expecting letter or digit
pFieldSelect :: Parser SelectItem
pFieldSelect = lexeme $
try (
do
alias <- optionMaybe ( try(pFieldName <* aliasSeparator) )
fld <- pField
cast' <- optionMaybe (string "::" *> many pIdentifierChar)
cast' <- optionMaybe (string "::" *> many1 pIdentifierChar)
pEnd
return $ SelectField fld (toS <$> cast') alias
)