add simple create table support
This commit is contained in:
parent
2938f642d3
commit
6802aaef5a
4 changed files with 59 additions and 4 deletions
Language/SQL/SimpleSQL
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue