1
Fork 0

example of a custom dialect which allows date('xxx') syntax by removing 'date' from the list of keywords

This commit is contained in:
Jake Wheat 2019-08-31 13:50:12 +01:00
parent 206982cd0a
commit 1a1913e7b8
4 changed files with 18 additions and 3 deletions
tools/Language/SQL/SimpleSQL

View file

@ -0,0 +1,11 @@
> module Language.SQL.SimpleSQL.CustomDialect (customDialectTests) where
> import Language.SQL.SimpleSQL.TestTypes
> customDialectTests :: TestItem
> customDialectTests = Group "custom dialect tests" (map (ParseQueryExpr myDialect) sometests
> ++ [ParseScalarExprFails ansi2011 "SELECT DATE('2000-01-01')"])
> where
> myDialect = ansi2011 {diKeywords = filter (/="date") (diKeywords ansi2011)}
> sometests = ["SELECT DATE('2000-01-01')"]