2013-12-17 10:48:40 +01:00
|
|
|
|
|
|
|
These are the tests for the queryExprs parsing which parses multiple
|
|
|
|
query expressions from one string.
|
|
|
|
|
|
|
|
> module Language.SQL.SimpleSQL.QueryExprs (queryExprsTests) where
|
|
|
|
|
|
|
|
> import Language.SQL.SimpleSQL.TestTypes
|
|
|
|
> import Language.SQL.SimpleSQL.Syntax
|
|
|
|
|
|
|
|
> queryExprsTests :: TestItem
|
2016-02-12 11:51:06 +01:00
|
|
|
> queryExprsTests = Group "query exprs" $ map (uncurry (TestStatements ansi2011))
|
2013-12-17 10:48:40 +01:00
|
|
|
> [("select 1",[ms])
|
|
|
|
> ,("select 1;",[ms])
|
|
|
|
> ,("select 1;select 1",[ms,ms])
|
|
|
|
> ,(" select 1;select 1; ",[ms,ms])
|
2019-08-31 11:08:02 +02:00
|
|
|
> ,("SELECT CURRENT_TIMESTAMP;"
|
|
|
|
> ,[SelectStatement $ makeSelect
|
|
|
|
> {qeSelectList = [(Iden [Name Nothing "CURRENT_TIMESTAMP"],Nothing)]}])
|
|
|
|
> ,("SELECT \"CURRENT_TIMESTAMP\";"
|
|
|
|
> ,[SelectStatement $ makeSelect
|
|
|
|
> {qeSelectList = [(Iden [Name (Just ("\"","\"")) "CURRENT_TIMESTAMP"],Nothing)]}])
|
2013-12-17 10:48:40 +01:00
|
|
|
> ]
|
|
|
|
> where
|
2015-08-01 19:26:00 +02:00
|
|
|
> ms = SelectStatement $ makeSelect {qeSelectList = [(NumLit "1",Nothing)]}
|