example how to switch parsing and pretty printing depending on dialect
This commit is contained in:
parent
7d63c8f8e5
commit
c1c514af35
6 changed files with 206 additions and 157 deletions
tools/Language/SQL/SimpleSQL
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue