start on dialect prototype code
This commit is contained in:
parent
7914898cc8
commit
7d63c8f8e5
18 changed files with 207 additions and 129 deletions
tools/Language/SQL/SimpleSQL
36
tools/Language/SQL/SimpleSQL/MySQL.lhs
Normal file
36
tools/Language/SQL/SimpleSQL/MySQL.lhs
Normal file
|
@ -0,0 +1,36 @@
|
|||
|
||||
Tests for mysql dialect parsing
|
||||
|
||||
> module Language.SQL.SimpleSQL.MySQL (mySQLTests) where
|
||||
|
||||
> import Language.SQL.SimpleSQL.TestTypes
|
||||
> import Language.SQL.SimpleSQL.Syntax
|
||||
|
||||
> mySQLTests :: TestItem
|
||||
> mySQLTests = Group "mysql dialect"
|
||||
> [backtickQuotes
|
||||
> ,limit]
|
||||
|
||||
backtick quotes
|
||||
|
||||
limit syntax
|
||||
|
||||
[LIMIT {[offset,] row_count | row_count OFFSET offset}]
|
||||
|
||||
> backtickQuotes :: TestItem
|
||||
> backtickQuotes = Group "backtickQuotes" $ map (uncurry (TestValueExpr MySQL))
|
||||
> [("`test`", Iden [DQName "`" "`" "test"])
|
||||
> ]
|
||||
|
||||
|
||||
> limit :: TestItem
|
||||
> limit = Group "queries" $ map (uncurry (TestQueryExpr MySQL))
|
||||
> [("select * from t limit 5"
|
||||
> ,sel {qeFetchFirst = Just (NumLit "5")}
|
||||
> )
|
||||
> ]
|
||||
> where
|
||||
> sel = makeSelect
|
||||
> {qeSelectList = [(Star, Nothing)]
|
||||
> ,qeFrom = [TRSimple [Name "t"]]
|
||||
> }
|
Loading…
Add table
Add a link
Reference in a new issue