1
Fork 0

example how to switch parsing and pretty printing depending on dialect

This commit is contained in:
Jake Wheat 2014-06-28 15:41:11 +03:00
parent 7d63c8f8e5
commit c1c514af35
6 changed files with 206 additions and 157 deletions
tools/Language/SQL/SimpleSQL

View file

@ -18,17 +18,21 @@ limit syntax
[LIMIT {[offset,] row_count | row_count OFFSET offset}]
> backtickQuotes :: TestItem
> backtickQuotes = Group "backtickQuotes" $ map (uncurry (TestValueExpr MySQL))
> backtickQuotes = Group "backtickQuotes" (map (uncurry (TestValueExpr MySQL))
> [("`test`", Iden [DQName "`" "`" "test"])
> ]
> ++ [ParseValueExprFails SQL2011 "`test`"]
> )
> limit :: TestItem
> limit = Group "queries" $ map (uncurry (TestQueryExpr MySQL))
> limit = Group "queries" ( map (uncurry (TestQueryExpr MySQL))
> [("select * from t limit 5"
> ,sel {qeFetchFirst = Just (NumLit "5")}
> )
> ]
> ++ [ParseQueryExprFails MySQL "select a from t fetch next 10 rows only;"
> ,ParseQueryExprFails SQL2011 "select * from t limit 5"]
> )
> where
> sel = makeSelect
> {qeSelectList = [(Star, Nothing)]