add schema support for create index referenced table, and add some tests
This commit is contained in:
parent
f019c2d1ed
commit
05481371dd
6 changed files with 34 additions and 3 deletions
Language/SQL/SimpleSQL
|
@ -1511,7 +1511,7 @@ TODO: change style
|
|||
> <$> ((keyword_ "index" >> pure False) <|>
|
||||
> (keywords_ ["unique", "index"] >> pure True))
|
||||
> <*> names
|
||||
> <*> (keyword_ "on" >> name)
|
||||
> <*> (keyword_ "on" >> names)
|
||||
> <*> parens (commaSep1 name)
|
||||
|
||||
> columnDef :: Parser ColumnDef
|
||||
|
|
|
@ -531,6 +531,15 @@ Try to do this when this code is ported to a modern pretty printing lib.
|
|||
> statement _ (DropAssertion nm db) =
|
||||
> text "drop" <+> text "assertion" <+> names nm <+> dropBehav db
|
||||
|
||||
> statement _ (CreateIndex un nm tbl cols) =
|
||||
> texts (if un
|
||||
> then ["create","unique","index"]
|
||||
> else ["create","index"])
|
||||
> <+> names nm
|
||||
> <+> text "on"
|
||||
> <+> names tbl
|
||||
> <+> parens (commaSep $ map name cols)
|
||||
|
||||
== dml
|
||||
|
||||
> statement d (SelectStatement q) = queryExpr d q
|
||||
|
|
|
@ -454,7 +454,7 @@ I'm not sure if this is valid syntax or not.
|
|||
> | CreateTable [Name] [TableElement]
|
||||
> | AlterTable [Name] AlterTableAction
|
||||
> | DropTable [Name] DropBehaviour
|
||||
> | CreateIndex Bool [Name] Name [Name]
|
||||
> | CreateIndex Bool [Name] [Name] [Name]
|
||||
> | CreateView Bool [Name] (Maybe [Name])
|
||||
> QueryExpr (Maybe CheckOption)
|
||||
> | DropView [Name] DropBehaviour
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue