1
Fork 0

add default and identity to create table

This commit is contained in:
Jake Wheat 2015-08-02 18:04:40 +03:00
parent 056cd1afda
commit e495e240c0
4 changed files with 260 additions and 16 deletions
Language/SQL/SimpleSQL

View file

@ -36,7 +36,10 @@
> ,IdentityRestart(..)
> ,InsertSource(..)
> ,SetClause(..)
> ,TableElement(..)
> ,TableElement(..)
> ,DefaultClause(..)
> ,IdentityWhen(..)
> ,SequenceGeneratorOption(..)
> -- * Dialect
> ,Dialect(..)
> -- * Comment
@ -489,7 +492,7 @@ I'm not sure if this is valid syntax or not.
> data TableElement =
> ColumnDef Name TypeName
> -- (Maybe DefaultClause)
> (Maybe DefaultClause)
> -- (Maybe ColumnConstraintDef)
> -- (Maybe CollateClause)
> -- | TableConstraintDef
@ -498,10 +501,28 @@ I'm not sure if this is valid syntax or not.
> {-data TableConstraintDef
> deriving (Eq,Show,Read,Data,Typeable) -}
> {-data DefaultClause =
> data DefaultClause =
> DefaultClause ValueExpr
> | IdentityColumnSpec
> | GenerationClause-}
> | IdentityColumnSpec IdentityWhen [SequenceGeneratorOption]
> -- | GenerationClause
> deriving (Eq,Show,Read,Data,Typeable)
> data IdentityWhen =
> GeneratedDefault
> | GeneratedAlways
> | GeneratedByDefault
> deriving (Eq,Show,Read,Data,Typeable)
> data SequenceGeneratorOption =
> SGOStartWith Integer
> | SGOIncrementBy Integer
> | SGOMaxValue Integer
> | SGONoMaxValue
> | SGOMinValue Integer
> | SGONoMinValue
> | SGOCycle
> | SGONoCycle
> deriving (Eq,Show,Read,Data,Typeable)
> {-data ColumnConstraintDef =
> | NotNullConstraint