Documentation ¶
Index ¶
- Constants
- type AddExpr
- type AlterAttributeExpr
- type AlterExpr
- type AlterStmt
- type BinaryExpr
- type BracketBlock
- type ConstraintCheckExpr
- type ConstraintCommon
- type ConstraintDefaultExpr
- type ConstraintExpr
- type ConstraintForeignKeyExpr
- type ConstraintInterface
- type ConstraintNullableExpr
- type ConstraintPrimaryKeyExpr
- type ConstraintUniqueExpr
- type ConstraintWithColumns
- type CreateStmt
- type DataTypeExpr
- type Default
- type Dependencies
- type DropExpr
- type DropStmt
- type EnumDescription
- type False
- type FncCall
- type InsertStmt
- type Integer
- type Literal
- type NamedConstraintExpr
- type NamedObject
- type NotNullClause
- type Nullable
- type OnConflict
- type OnDeleteUpdateRule
- type RecordDescription
- type SchemaExpr
- type SelectStmt
- type Selector
- type SetDrop
- type SetDropExpr
- type SetExpr
- type SqlExpr
- type SqlField
- type SqlIdent
- type SqlNullable
- type SqlRename
- type SqlStmt
- type SqlTarget
- type String
- type TableBodyDescriber
- type TableDesc
- type True
- type UnaryExpr
- type UnnamedConstraintExpr
- type UpdateStmt
- type WithStmt
- type WithoutNameIdent
Constants ¶
View Source
const ( TargetNone SqlTarget = iota TargetSchema TargetTable TargetColumn TargetDomain TargetType TargetConstraint RuleNoAction OnDeleteUpdateRule = iota RuleCascade RuleRestrict RuleSetNull RuleSetDefault NullableNull Nullable = true NullableNotNull Nullable = false SetDropDrop SetDrop = false SetDropSet SetDrop = true )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlterAttributeExpr ¶
func (*AlterAttributeExpr) String ¶
func (c *AlterAttributeExpr) String() string
type BinaryExpr ¶
func (*BinaryExpr) String ¶
func (c *BinaryExpr) String() string
type BracketBlock ¶
func (*BracketBlock) String ¶
func (c *BracketBlock) String() string
type ConstraintCheckExpr ¶
type ConstraintCheckExpr struct { ConstraintCommon Expression SqlExpr Where SqlExpr }
check
func (*ConstraintCheckExpr) ConstraintParams ¶
func (c *ConstraintCheckExpr) ConstraintParams() string
func (*ConstraintCheckExpr) ConstraintString ¶
func (c *ConstraintCheckExpr) ConstraintString() string
type ConstraintCommon ¶
type ConstraintCommon struct {
InColumn bool
}
type ConstraintDefaultExpr ¶
type ConstraintDefaultExpr struct { ConstraintCommon Expression SqlExpr }
default
func (*ConstraintDefaultExpr) ConstraintParams ¶
func (c *ConstraintDefaultExpr) ConstraintParams() string
func (*ConstraintDefaultExpr) ConstraintString ¶
func (c *ConstraintDefaultExpr) ConstraintString() string
type ConstraintExpr ¶
type ConstraintExpr interface { ConstraintInterface SqlExpr }
type ConstraintForeignKeyExpr ¶
type ConstraintForeignKeyExpr struct { ConstraintCommon ToTable SqlIdent ToColumn string OnDelete OnDeleteUpdateRule OnUpdate OnDeleteUpdateRule }
foreign key
func (*ConstraintForeignKeyExpr) ConstraintParams ¶
func (c *ConstraintForeignKeyExpr) ConstraintParams() string
func (*ConstraintForeignKeyExpr) ConstraintString ¶
func (c *ConstraintForeignKeyExpr) ConstraintString() string
type ConstraintInterface ¶
type ConstraintNullableExpr ¶
type ConstraintNullableExpr struct { ConstraintCommon Nullable Nullable }
not null
func (*ConstraintNullableExpr) ConstraintParams ¶
func (c *ConstraintNullableExpr) ConstraintParams() string
func (*ConstraintNullableExpr) ConstraintString ¶
func (c *ConstraintNullableExpr) ConstraintString() string
type ConstraintPrimaryKeyExpr ¶
type ConstraintPrimaryKeyExpr struct {
ConstraintCommon
}
primary key
func (*ConstraintPrimaryKeyExpr) ConstraintParams ¶
func (c *ConstraintPrimaryKeyExpr) ConstraintParams() string
func (*ConstraintPrimaryKeyExpr) ConstraintString ¶
func (c *ConstraintPrimaryKeyExpr) ConstraintString() string
type ConstraintUniqueExpr ¶
type ConstraintUniqueExpr struct {
ConstraintCommon
}
unique
func (*ConstraintUniqueExpr) ConstraintParams ¶
func (c *ConstraintUniqueExpr) ConstraintParams() string
func (*ConstraintUniqueExpr) ConstraintString ¶
func (c *ConstraintUniqueExpr) ConstraintString() string
type ConstraintWithColumns ¶
type ConstraintWithColumns struct { Columns []string Constraint ConstraintExpr }
func (*ConstraintWithColumns) ConstraintParams ¶
func (c *ConstraintWithColumns) ConstraintParams() string
func (*ConstraintWithColumns) ConstraintString ¶
func (c *ConstraintWithColumns) ConstraintString() string
func (*ConstraintWithColumns) String ¶
func (c *ConstraintWithColumns) String() string
type CreateStmt ¶
func (*CreateStmt) String ¶
func (c *CreateStmt) String() string
type DataTypeExpr ¶
type DataTypeExpr struct { DataType string IsArray bool Length *int Precision *int Collation *string } // NotNull and Default - this is not about data type, this is about Constraints
func (*DataTypeExpr) String ¶
func (c *DataTypeExpr) String() string
type Dependencies ¶
type Dependencies []NamedObject
func ExploreDependencies ¶
func ExploreDependencies(stmt SqlStmt) Dependencies
func ExploreResolved ¶
func ExploreResolved(stmt SqlStmt) Dependencies
type EnumDescription ¶
type EnumDescription struct {
Values []*String
}
func (*EnumDescription) String ¶
func (c *EnumDescription) String() string
type InsertStmt ¶
type InsertStmt struct { Table TableDesc Insert map[string]SqlExpr OnConflict *OnConflict }
func (*InsertStmt) String ¶
func (c *InsertStmt) String() string
type NamedConstraintExpr ¶
type NamedConstraintExpr struct { Name SqlIdent Constraint ConstraintInterface }
func (*NamedConstraintExpr) ConstraintParams ¶
func (c *NamedConstraintExpr) ConstraintParams() string
func (*NamedConstraintExpr) ConstraintString ¶
func (c *NamedConstraintExpr) ConstraintString() string
func (*NamedConstraintExpr) String ¶
func (c *NamedConstraintExpr) String() string
type NamedObject ¶
type NotNullClause ¶
type NotNullClause struct{}
func (*NotNullClause) String ¶
func (c *NotNullClause) String() string
type OnConflict ¶
func (*OnConflict) String ¶
func (c *OnConflict) String() string
type OnDeleteUpdateRule ¶
type OnDeleteUpdateRule int
func (OnDeleteUpdateRule) String ¶
func (c OnDeleteUpdateRule) String() string
type RecordDescription ¶
type RecordDescription struct {
Fields []SqlExpr
}
func (*RecordDescription) String ¶
func (c *RecordDescription) String() string
type SchemaExpr ¶
type SchemaExpr struct {
SchemaName string
}
func (*SchemaExpr) String ¶
func (c *SchemaExpr) String() string
type SelectStmt ¶
func (*SelectStmt) String ¶
func (c *SelectStmt) String() string
type SetDropExpr ¶
func (*SetDropExpr) String ¶
func (c *SetDropExpr) String() string
type SqlExpr ¶
type SqlExpr interface { String() string // contains filtered or unexported methods }
type SqlField ¶
type SqlField struct { Name SqlIdent Describer *DataTypeExpr Constraints []ConstraintExpr }
type SqlNullable ¶
type SqlNullable struct {
Nullable Nullable
}
func (*SqlNullable) String ¶
func (c *SqlNullable) String() string
type SqlStmt ¶
type SqlStmt interface { String() string // contains filtered or unexported methods }
type TableBodyDescriber ¶
type TableBodyDescriber struct { Fields []*SqlField Constraints []ConstraintExpr }
func (*TableBodyDescriber) String ¶
func (c *TableBodyDescriber) String() string
type UnnamedConstraintExpr ¶
type UnnamedConstraintExpr struct {
Constraint ConstraintInterface
}
func (*UnnamedConstraintExpr) ConstraintParams ¶
func (c *UnnamedConstraintExpr) ConstraintParams() string
func (*UnnamedConstraintExpr) ConstraintString ¶
func (c *UnnamedConstraintExpr) ConstraintString() string
func (*UnnamedConstraintExpr) String ¶
func (c *UnnamedConstraintExpr) String() string
type UpdateStmt ¶
func (*UpdateStmt) String ¶
func (c *UpdateStmt) String() string
type WithStmt ¶
type WithStmt struct { Name string With SelectStmt Select SelectStmt }
type WithoutNameIdent ¶
type WithoutNameIdent struct{}
func (*WithoutNameIdent) GetName ¶
func (c *WithoutNameIdent) GetName() string
Click to show internal directories.
Click to hide internal directories.