1
Fork 0

add schema support for create index referenced table, and add some tests

This commit is contained in:
Jake 2021-10-19 16:32:25 +01:00
parent f019c2d1ed
commit 05481371dd
6 changed files with 34 additions and 3 deletions
tools/Language/SQL/SimpleSQL

View file

@ -0,0 +1,17 @@
> module Language.SQL.SimpleSQL.CreateIndex where
>
> import Language.SQL.SimpleSQL.Syntax
> import Language.SQL.SimpleSQL.TestTypes
>
> createIndexTests :: TestItem
> createIndexTests = Group "create index tests"
> [TestStatement ansi2011 "create index a on tbl(c1)"
> $ CreateIndex False [nm "a"] [nm "tbl"] [nm "c1"]
> ,TestStatement ansi2011 "create index a.b on sc.tbl (c1, c2)"
> $ CreateIndex False [nm "a", nm "b"] [nm "sc", nm "tbl"] [nm "c1", nm "c2"]
> ,TestStatement ansi2011 "create unique index a on tbl(c1)"
> $ CreateIndex True [nm "a"] [nm "tbl"] [nm "c1"]
> ]
> where
> nm = Name Nothing

View file

@ -30,6 +30,7 @@ test data to the Test.Framework tests.
> import Language.SQL.SimpleSQL.Tpch
> import Language.SQL.SimpleSQL.LexerTests
> import Language.SQL.SimpleSQL.EmptyStatement
> import Language.SQL.SimpleSQL.CreateIndex
> import Language.SQL.SimpleSQL.SQL2011Queries
> import Language.SQL.SimpleSQL.SQL2011AccessControl
@ -41,6 +42,7 @@ test data to the Test.Framework tests.
> import Language.SQL.SimpleSQL.Oracle
> import Language.SQL.SimpleSQL.CustomDialect
Order the tests to start from the simplest first. This is also the
order on the generated documentation.
@ -66,6 +68,7 @@ order on the generated documentation.
> ,oracleTests
> ,customDialectTests
> ,emptyStatementTests
> ,createIndexTests
> ]
> tests :: T.TestTree