add drop table support
This commit is contained in:
parent
f0baa3c37b
commit
8291fbaa44
4 changed files with 29 additions and 16 deletions
Language/SQL/SimpleSQL
|
@ -1444,7 +1444,8 @@ TODO: change style
|
|||
> [keyword_ "create" *> choice [createSchema
|
||||
> ,createTable]
|
||||
> ,keyword_ "alter" *> choice [alterTable]
|
||||
> ,keyword_ "drop" *> choice [dropSchema]
|
||||
> ,keyword_ "drop" *> choice [dropSchema
|
||||
> ,dropTable]
|
||||
> ,delete
|
||||
> ,truncateSt
|
||||
> ,insert
|
||||
|
@ -1611,8 +1612,12 @@ slightly hacky parser for signed integers
|
|||
|
||||
> dropSchema :: Parser Statement
|
||||
> dropSchema = keyword_ "schema" >>
|
||||
> DropSchema <$> names
|
||||
> <*> dropBehaviour
|
||||
> DropSchema <$> names <*> dropBehaviour
|
||||
|
||||
> dropTable :: Parser Statement
|
||||
> dropTable = keyword_ "table" >>
|
||||
> DropTable <$> names <*> dropBehaviour
|
||||
|
||||
|
||||
> delete :: Parser Statement
|
||||
> 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 "="
|
||||
> <+> parens (commaSep $ map (valueExpr d) vs)
|
||||
|
||||
> statement _ (DropTable n b) =
|
||||
> text "drop" <+> text "table" <+> names n <+> dropBehav b
|
||||
|
||||
== access control
|
||||
|
||||
== transactions
|
||||
|
|
|
@ -401,16 +401,16 @@ I'm not sure if this is valid syntax or not.
|
|||
|
||||
> data Statement =
|
||||
> -- ddl
|
||||
> CreateSchema [Name] -- XXX
|
||||
> | DropSchema [Name] DropBehaviour -- XXX
|
||||
> CreateSchema [Name]
|
||||
> | DropSchema [Name] DropBehaviour
|
||||
> | CreateTable [Name] [TableElement]
|
||||
> | AlterTable [Name] AlterTableAction
|
||||
> {- | DropTable -- XXX
|
||||
> | CreateView -- XXX
|
||||
> | DropView -- XXX
|
||||
> | CreateDomain -- XXX
|
||||
> | DropTable [Name] DropBehaviour
|
||||
> {- | CreateView
|
||||
> | DropView
|
||||
> | CreateDomain
|
||||
> | AlterDomain
|
||||
> | DropDomain -- XXX
|
||||
> | DropDomain
|
||||
> | CreateCharacterSet
|
||||
> | DropCharacterSet
|
||||
> | CreateCollation
|
||||
|
@ -430,9 +430,9 @@ I'm not sure if this is valid syntax or not.
|
|||
> | CreateOrdering
|
||||
> | DropOrdering
|
||||
> -- transforms
|
||||
> | CreateSequence -- XXX
|
||||
> | AlterSequence -- XXX
|
||||
> | DropSequence -- XXX -}
|
||||
> | CreateSequence
|
||||
> | AlterSequence
|
||||
> | DropSequence -}
|
||||
> -- dml
|
||||
> | SelectStatement QueryExpr
|
||||
> {- | DeclareCursor
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue