Documentation ¶
Index ¶
- Variables
- func New(config Config) gorm.Dialector
- func Open(dsn string) gorm.Dialector
- type Column
- func (c Column) AutoIncrement() (isAutoIncrement bool, ok bool)
- func (c Column) ColumnType() (columnType string, ok bool)
- func (c Column) Comment() (value string, ok bool)
- func (c Column) DatabaseTypeName() string
- func (c Column) DecimalSize() (int64, int64, bool)
- func (c Column) DefaultValue() (value string, ok bool)
- func (c Column) Length() (int64, bool)
- func (c Column) Name() string
- func (c Column) Nullable() (bool, bool)
- func (c Column) PrimaryKey() (isPrimaryKey bool, ok bool)
- func (c Column) ScanType() reflect.Type
- func (c Column) Unique() (unique bool, ok bool)
- type Config
- type Dialector
- func (dialector Dialector) Apply(config *gorm.Config) error
- func (dialector Dialector) BindVarTo(writer clause.Writer, stmt *gorm.Statement, v interface{})
- func (dialector Dialector) ClauseBuilders() map[string]clause.ClauseBuilder
- func (dialector Dialector) DataTypeOf(field *schema.Field) string
- func (dialector Dialector) DefaultValueOf(field *schema.Field) clause.Expression
- func (dialector Dialector) Explain(sql string, vars ...interface{}) string
- func (dialector Dialector) Initialize(db *gorm.DB) (err error)
- func (dialector Dialector) Migrator(db *gorm.DB) gorm.Migrator
- func (dialector Dialector) Name() string
- func (dialector Dialector) NowFunc(n int) func() time.Time
- func (dialector Dialector) QuoteTo(writer clause.Writer, str string)
- type Migrator
- func (m Migrator) AlterColumn(value interface{}, field string) error
- func (m Migrator) ColumnTypes(value interface{}) ([]gorm.ColumnType, error)
- func (m Migrator) DropConstraint(value interface{}, name string) error
- func (m Migrator) DropTable(values ...interface{}) error
- func (m Migrator) HasColumn(value interface{}, field string) bool
- func (m Migrator) HasConstraint(value interface{}, name string) bool
- func (m Migrator) HasIndex(value interface{}, name string) bool
- func (m Migrator) HasTable(value interface{}) bool
- func (m Migrator) RenameColumn(value interface{}, oldName, newName string) error
- func (m Migrator) RenameIndex(value interface{}, oldName, newName string) error
- type NamingStrategy
- func (ns NamingStrategy) CheckerName(table, column string) (name string)
- func (ns NamingStrategy) ColumnName(table, column string) string
- func (ns NamingStrategy) IndexName(table, column string) (name string)
- func (ns NamingStrategy) JoinTableName(table string) (name string)
- func (ns NamingStrategy) RelationshipFKName(relationship schema.Relationship) (name string)
- func (ns NamingStrategy) TableName(str string) string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // CreateClauses create clauses CreateClauses = []string{"INSERT", "VALUES", ""} // UpdateClauses update clauses UpdateClauses = []string{"UPDATE", "SET", "WHERE", "ORDER BY", "LIMIT"} // DeleteClauses delete clauses DeleteClauses = []string{"DELETE", "FROM", "WHERE", "ORDER BY", "LIMIT"} )
Functions ¶
Types ¶
type Column ¶
type Column struct {
// contains filtered or unexported fields
}
func (Column) AutoIncrement ¶ added in v1.0.5
func (Column) ColumnType ¶ added in v1.0.5
func (Column) DatabaseTypeName ¶
func (Column) DecimalSize ¶
DecimalSize return precision int64, scale int64, ok bool
func (Column) DefaultValue ¶ added in v1.0.5
func (Column) PrimaryKey ¶ added in v1.0.5
type Dialector ¶
type Dialector struct {
*Config
}
func (Dialector) ClauseBuilders ¶
func (dialector Dialector) ClauseBuilders() map[string]clause.ClauseBuilder
func (Dialector) DefaultValueOf ¶
func (dialector Dialector) DefaultValueOf(field *schema.Field) clause.Expression
type Migrator ¶
func (Migrator) AlterColumn ¶
func (Migrator) ColumnTypes ¶
func (m Migrator) ColumnTypes(value interface{}) ([]gorm.ColumnType, error)
ColumnTypes column types return columnTypes,error
func (Migrator) DropConstraint ¶
func (Migrator) HasConstraint ¶
func (Migrator) RenameColumn ¶
func (Migrator) RenameIndex ¶
type NamingStrategy ¶
type NamingStrategy struct {
schema.NamingStrategy
}
func (NamingStrategy) CheckerName ¶
func (ns NamingStrategy) CheckerName(table, column string) (name string)
func (NamingStrategy) ColumnName ¶
func (ns NamingStrategy) ColumnName(table, column string) string
func (NamingStrategy) IndexName ¶
func (ns NamingStrategy) IndexName(table, column string) (name string)
func (NamingStrategy) JoinTableName ¶
func (ns NamingStrategy) JoinTableName(table string) (name string)
func (NamingStrategy) RelationshipFKName ¶
func (ns NamingStrategy) RelationshipFKName(relationship schema.Relationship) (name string)
func (NamingStrategy) TableName ¶
func (ns NamingStrategy) TableName(str string) string
Click to show internal directories.
Click to hide internal directories.