add create and drop assertion
This commit is contained in:
parent
3c0788af6e
commit
c102528d5f
4 changed files with 45 additions and 5 deletions
Language/SQL/SimpleSQL
|
@ -1460,7 +1460,8 @@ TODO: change style
|
|||
> ,createView
|
||||
> ,createDomain
|
||||
> ,createSequence
|
||||
> ,createRole]
|
||||
> ,createRole
|
||||
> ,createAssertion]
|
||||
> ,keyword_ "alter" *> choice [alterTable
|
||||
> ,alterDomain
|
||||
> ,alterSequence]
|
||||
|
@ -1469,7 +1470,8 @@ TODO: change style
|
|||
> ,dropView
|
||||
> ,dropDomain
|
||||
> ,dropSequence
|
||||
> ,dropRole]
|
||||
> ,dropRole
|
||||
> ,dropAssertion]
|
||||
> ,delete
|
||||
> ,truncateSt
|
||||
> ,insert
|
||||
|
@ -1726,6 +1728,17 @@ slightly hacky parser for signed integers
|
|||
> dropSequence = keyword_ "sequence" >>
|
||||
> DropSequence <$> names <*> dropBehaviour
|
||||
|
||||
> createAssertion :: Parser Statement
|
||||
> createAssertion = keyword_ "assertion" >>
|
||||
> CreateAssertion
|
||||
> <$> names
|
||||
> <*> (keyword_ "check" *> parens valueExpr)
|
||||
|
||||
|
||||
> dropAssertion :: Parser Statement
|
||||
> dropAssertion = keyword_ "assertion" >>
|
||||
> DropAssertion <$> names <*> dropBehaviour
|
||||
|
||||
-----------------
|
||||
|
||||
= dml
|
||||
|
|
|
@ -508,6 +508,14 @@ which have been changed to try to improve the layout of the output.
|
|||
> statement _ (DropSequence nm db) =
|
||||
> text "drop" <+> text "sequence" <+> names nm <+> dropBehav db
|
||||
|
||||
|
||||
> statement d (CreateAssertion nm ex) =
|
||||
> texts ["create","assertion"] <+> names nm
|
||||
> <+> text "check" <+> parens (valueExpr d ex)
|
||||
|
||||
> statement _ (DropAssertion nm db) =
|
||||
> text "drop" <+> text "assertion" <+> names nm <+> dropBehav db
|
||||
|
||||
== dml
|
||||
|
||||
> statement d (SelectStatement q) = queryExpr d q
|
||||
|
|
|
@ -431,9 +431,9 @@ I'm not sure if this is valid syntax or not.
|
|||
> | DropCollation
|
||||
> | CreateTranslation
|
||||
> | DropTranslation -}
|
||||
> {- | CreateAssertion
|
||||
> | DropAssertion
|
||||
> | CreateTrigger
|
||||
> | CreateAssertion [Name] ValueExpr
|
||||
> | DropAssertion [Name] DropBehaviour
|
||||
> {- | CreateTrigger
|
||||
> | DropTrigger
|
||||
> | CreateType
|
||||
> | AlterType
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue