add drop table support
This commit is contained in:
parent
f0baa3c37b
commit
8291fbaa44
|
@ -1444,7 +1444,8 @@ TODO: change style
|
||||||
> [keyword_ "create" *> choice [createSchema
|
> [keyword_ "create" *> choice [createSchema
|
||||||
> ,createTable]
|
> ,createTable]
|
||||||
> ,keyword_ "alter" *> choice [alterTable]
|
> ,keyword_ "alter" *> choice [alterTable]
|
||||||
> ,keyword_ "drop" *> choice [dropSchema]
|
> ,keyword_ "drop" *> choice [dropSchema
|
||||||
|
> ,dropTable]
|
||||||
> ,delete
|
> ,delete
|
||||||
> ,truncateSt
|
> ,truncateSt
|
||||||
> ,insert
|
> ,insert
|
||||||
|
@ -1611,8 +1612,12 @@ slightly hacky parser for signed integers
|
||||||
|
|
||||||
> dropSchema :: Parser Statement
|
> dropSchema :: Parser Statement
|
||||||
> dropSchema = keyword_ "schema" >>
|
> dropSchema = keyword_ "schema" >>
|
||||||
> DropSchema <$> names
|
> DropSchema <$> names <*> dropBehaviour
|
||||||
> <*> dropBehaviour
|
|
||||||
|
> dropTable :: Parser Statement
|
||||||
|
> dropTable = keyword_ "table" >>
|
||||||
|
> DropTable <$> names <*> dropBehaviour
|
||||||
|
|
||||||
|
|
||||||
> delete :: Parser Statement
|
> delete :: Parser Statement
|
||||||
> delete = keywords_ ["delete","from"] >>
|
> delete = keywords_ ["delete","from"] >>
|
||||||
|
|
|
@ -502,6 +502,9 @@ which have been changed to try to improve the layout of the output.
|
||||||
> sc (SetMultiple ts vs) = parens (commaSep $ map names ts) <+> text "="
|
> sc (SetMultiple ts vs) = parens (commaSep $ map names ts) <+> text "="
|
||||||
> <+> parens (commaSep $ map (valueExpr d) vs)
|
> <+> parens (commaSep $ map (valueExpr d) vs)
|
||||||
|
|
||||||
|
> statement _ (DropTable n b) =
|
||||||
|
> text "drop" <+> text "table" <+> names n <+> dropBehav b
|
||||||
|
|
||||||
== access control
|
== access control
|
||||||
|
|
||||||
== transactions
|
== transactions
|
||||||
|
|
|
@ -401,16 +401,16 @@ I'm not sure if this is valid syntax or not.
|
||||||
|
|
||||||
> data Statement =
|
> data Statement =
|
||||||
> -- ddl
|
> -- ddl
|
||||||
> CreateSchema [Name] -- XXX
|
> CreateSchema [Name]
|
||||||
> | DropSchema [Name] DropBehaviour -- XXX
|
> | DropSchema [Name] DropBehaviour
|
||||||
> | CreateTable [Name] [TableElement]
|
> | CreateTable [Name] [TableElement]
|
||||||
> | AlterTable [Name] AlterTableAction
|
> | AlterTable [Name] AlterTableAction
|
||||||
> {- | DropTable -- XXX
|
> | DropTable [Name] DropBehaviour
|
||||||
> | CreateView -- XXX
|
> {- | CreateView
|
||||||
> | DropView -- XXX
|
> | DropView
|
||||||
> | CreateDomain -- XXX
|
> | CreateDomain
|
||||||
> | AlterDomain
|
> | AlterDomain
|
||||||
> | DropDomain -- XXX
|
> | DropDomain
|
||||||
> | CreateCharacterSet
|
> | CreateCharacterSet
|
||||||
> | DropCharacterSet
|
> | DropCharacterSet
|
||||||
> | CreateCollation
|
> | CreateCollation
|
||||||
|
@ -430,9 +430,9 @@ I'm not sure if this is valid syntax or not.
|
||||||
> | CreateOrdering
|
> | CreateOrdering
|
||||||
> | DropOrdering
|
> | DropOrdering
|
||||||
> -- transforms
|
> -- transforms
|
||||||
> | CreateSequence -- XXX
|
> | CreateSequence
|
||||||
> | AlterSequence -- XXX
|
> | AlterSequence
|
||||||
> | DropSequence -- XXX -}
|
> | DropSequence -}
|
||||||
> -- dml
|
> -- dml
|
||||||
> | SelectStatement QueryExpr
|
> | SelectStatement QueryExpr
|
||||||
> {- | DeclareCursor
|
> {- | DeclareCursor
|
||||||
|
|
|
@ -1032,9 +1032,14 @@ defintely skip
|
||||||
<drop table statement> ::=
|
<drop table statement> ::=
|
||||||
DROP TABLE <table name> <drop behavior>
|
DROP TABLE <table name> <drop behavior>
|
||||||
|
|
||||||
drop table t
|
> ,(TestStatement SQL2011
|
||||||
drop table t cascade
|
> "drop table t"
|
||||||
drop table t restrict
|
> $ DropTable [Name "t"] DefaultDropBehaviour)
|
||||||
|
|
||||||
|
> ,(TestStatement SQL2011
|
||||||
|
> "drop table t restrict"
|
||||||
|
> $ DropTable [Name "t"] Restrict)
|
||||||
|
|
||||||
|
|
||||||
11.32 <view definition>
|
11.32 <view definition>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue