add generation clause support to create table
This commit is contained in:
parent
e495e240c0
commit
4f80ec96d4
4 changed files with 16 additions and 1 deletions
Language/SQL/SimpleSQL
|
@ -1472,6 +1472,9 @@ TODO: change style
|
|||
> defaultClause = choice [
|
||||
> keyword_ "default" >>
|
||||
> DefaultClause <$> valueExpr
|
||||
> -- todo: left factor
|
||||
> ,try (keywords_ ["generated","always","as"] >>
|
||||
> GenerationClause <$> parens valueExpr)
|
||||
> ,keyword_ "generated" >>
|
||||
> IdentityColumnSpec
|
||||
> <$> option GeneratedDefault
|
||||
|
|
|
@ -463,6 +463,8 @@ which have been changed to try to improve the layout of the output.
|
|||
> Nothing -> empty
|
||||
> Just (DefaultClause def) ->
|
||||
> text "default" <+> valueExpr d def
|
||||
> Just (GenerationClause e) ->
|
||||
> texts ["generated","always","as"] <+> parens (valueExpr d e)
|
||||
> Just (IdentityColumnSpec w o) ->
|
||||
> text "generated"
|
||||
> <+> (case w of
|
||||
|
|
|
@ -504,7 +504,7 @@ I'm not sure if this is valid syntax or not.
|
|||
> data DefaultClause =
|
||||
> DefaultClause ValueExpr
|
||||
> | IdentityColumnSpec IdentityWhen [SequenceGeneratorOption]
|
||||
> -- | GenerationClause
|
||||
> | GenerationClause ValueExpr
|
||||
> deriving (Eq,Show,Read,Data,Typeable)
|
||||
|
||||
> data IdentityWhen =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue