1
Fork 0

add simple create table support

This commit is contained in:
Jake Wheat 2015-08-01 23:16:26 +03:00
parent 2938f642d3
commit 6802aaef5a
4 changed files with 59 additions and 4 deletions
Language/SQL/SimpleSQL

View file

@ -36,6 +36,7 @@
> ,IdentityRestart(..)
> ,InsertSource(..)
> ,SetClause(..)
> ,TableElement(..)
> -- * Dialect
> ,Dialect(..)
> -- * Comment
@ -392,8 +393,8 @@ I'm not sure if this is valid syntax or not.
> -- ddl
> CreateSchema [Name] -- XXX
> | DropSchema [Name] DropBehaviour -- XXX
> {- | CreateTable -- XXX
> | AlterTable -- XXX
> | CreateTable [Name] [TableElement]
> {- | AlterTable -- XXX
> | DropTable -- XXX
> | CreateView -- XXX
> | DropView -- XXX
@ -486,6 +487,28 @@ I'm not sure if this is valid syntax or not.
> | SetMultiple [[Name]] [ValueExpr]
> deriving (Eq,Show,Read,Data,Typeable)
> data TableElement =
> ColumnDef Name TypeName
> (Maybe DefaultClause)
> -- (Maybe ColumnConstraintDef)
> -- (Maybe CollateClause)
> -- | TableConstraintDef
> deriving (Eq,Show,Read,Data,Typeable)
> {-data TableConstraintDef
> deriving (Eq,Show,Read,Data,Typeable) -}
> data DefaultClause =
> DefaultClause ValueExpr
> | IdentityColumnSpec
> | GenerationClause
> {-data ColumnConstraintDef =
> | NotNullConstraint
> | UniqueConstraint
> | ReferencesConstraint
> | CheckConstraint-}
--------------------------
> -- | Used to set the dialect used for parsing and pretty printing,