package schema

Import Path
	gorm.io/gorm/schema (on go.dev)

Dependency Relation
	imports 20 packages, and imported by 4 packages

Involved Source Files
	    check.go
	    field.go
	    index.go
	    interfaces.go
	    naming.go
	    relationship.go
	    schema.go
	    utils.go

Exported Type Names


type Constraint (struct) Field *Field ForeignKeys []*Field Name string OnDelete string OnUpdate string ReferenceSchema *Schema References []*Field Schema *Schema func (*Relationship).ParseConstraint() *Constraint
type CreateClausesInterface (interface) (T) CreateClauses(*Field) []clause.Interface
type DataType string const Bool const Bytes const Float const Int const String const Time const Uint
type DeleteClausesInterface (interface) (T) DeleteClauses(*Field) []clause.Interface gorm.io/gorm.DeletedAt
type Field (struct) AutoCreateTime TimeType AutoIncrement bool AutoUpdateTime TimeType BindNames []string Comment string Creatable bool DBName string DataType DataType DefaultValue string DefaultValueInterface interface{} EmbeddedSchema *Schema FieldType reflect.Type GORMDataType DataType HasDefaultValue bool IndirectFieldType reflect.Type Name string NotNull bool OwnerSchema *Schema Precision int PrimaryKey bool Readable bool ReflectValueOf func(reflect.Value) reflect.Value Scale int Schema *Schema Set func(reflect.Value, interface{}) error Size int StructField reflect.StructField Tag reflect.StructTag TagSettings map[string]string Unique bool Updatable bool ValueOf func(reflect.Value) (value interface{}, zero bool) func Schema.LookUpField(name string) *Field func (*Schema).ParseField(fieldStruct reflect.StructField) *Field func GetIdentityFieldValuesMap(reflectValue reflect.Value, fields []*Field) (map[string][]reflect.Value, [][]interface{}) func GetIdentityFieldValuesMapFromValues(values []interface{}, fields []*Field) (map[string][]reflect.Value, [][]interface{}) func CreateClausesInterface.CreateClauses(*Field) []clause.Interface func DeleteClausesInterface.DeleteClauses(*Field) []clause.Interface func QueryClausesInterface.QueryClauses(*Field) []clause.Interface func UpdateClausesInterface.UpdateClauses(*Field) []clause.Interface func gorm.io/gorm.DeletedAt.DeleteClauses(f *Field) []clause.Interface func gorm.io/gorm.DeletedAt.QueryClauses(f *Field) []clause.Interface func gorm.io/gorm.Dialector.DataTypeOf(*Field) string func gorm.io/gorm.Dialector.DefaultValueOf(*Field) clause.Expression func gorm.io/gorm.Migrator.FullDataTypeOf(*Field) clause.Expr func gorm.io/gorm.Migrator.MigrateColumn(dst interface{}, field *Field, columnType gorm.ColumnType) error func gorm.io/gorm/migrator.GormDataTypeInterface.GormDBDataType(*gorm.DB, *Field) string func gorm.io/gorm/migrator.Migrator.DataTypeOf(field *Field) string func gorm.io/gorm/migrator.Migrator.FullDataTypeOf(field *Field) (expr clause.Expr) func gorm.io/gorm/migrator.Migrator.MigrateColumn(value interface{}, field *Field, columnType gorm.ColumnType) error func gorm.io/driver/mysql.Dialector.DataTypeOf(field *Field) string func gorm.io/driver/mysql.Dialector.DefaultValueOf(field *Field) clause.Expression func gorm.io/driver/mysql.Migrator.FullDataTypeOf(field *Field) clause.Expr
type GormDataTypeInterface (interface) (T) GormDataType() string
type Index (struct) Class string Comment string Fields []IndexOption Name string Option string Type string Where string func (*Schema).LookIndex(name string) *Index func (*Schema).ParseIndexes() map[string]Index
type Namer (interface) Namer namer interface (T) CheckerName(table, column string) string (T) ColumnName(table, column string) string (T) IndexName(table, column string) string (T) JoinTableName(joinTable string) string (T) RelationshipFKName(Relationship) string (T) TableName(table string) string NamingStrategy func Parse(dest interface{}, cacheStore *sync.Map, namer Namer) (*Schema, error)
type NamingStrategy (struct) NamingStrategy tables, columns naming strategy SingularTable bool TablePrefix string (T) CheckerName(table, column string) string (T) ColumnName(table, column string) string (T) IndexName(table, column string) string (T) JoinTableName(str string) string (T) RelationshipFKName(rel Relationship) string (T) TableName(str string) string T : Namer
type Polymorphic (struct) PolymorphicID *Field PolymorphicType *Field Value string
type QueryClausesInterface (interface) (T) QueryClauses(*Field) []clause.Interface gorm.io/gorm.DeletedAt
type Relationship (struct) Field *Field FieldSchema *Schema JoinTable *Schema Name string Polymorphic *Polymorphic References []*Reference Schema *Schema Type RelationshipType (*T) ParseConstraint() *Constraint (*T) ToQueryConditions(reflectValue reflect.Value) (conds []clause.Expression) func GetRelationsValues(reflectValue reflect.Value, rels []*Relationship) (reflectResults reflect.Value) func Namer.RelationshipFKName(Relationship) string func NamingStrategy.RelationshipFKName(rel Relationship) string
type RelationshipType string RelationshipType relationship type const BelongsTo const HasMany const HasOne const Many2Many
type Tabler (interface) (T) TableName() string
type TimeType int64 const UnixMillisecond const UnixNanosecond const UnixSecond
type UpdateClausesInterface (interface) (T) UpdateClauses(*Field) []clause.Interface
Exported Values
const BelongsTo RelationshipType = "belongs_to" // BelongsToRel belongs to relationship
const Bool DataType = "bool"
const Bytes DataType = "bytes"
var ErrUnsupportedDataType error ErrUnsupportedDataType unsupported data type
const Float DataType = "float"
func GetIdentityFieldValuesMap(reflectValue reflect.Value, fields []*Field) (map[string][]reflect.Value, [][]interface{}) GetIdentityFieldValuesMap get identity map from fields
func GetIdentityFieldValuesMapFromValues(values []interface{}, fields []*Field) (map[string][]reflect.Value, [][]interface{}) GetIdentityFieldValuesMapFromValues get identity map from fields
func GetRelationsValues(reflectValue reflect.Value, rels []*Relationship) (reflectResults reflect.Value) GetRelationsValues get relations's values from a reflect value
const HasMany RelationshipType = "has_many" // HasManyRel has many relationship
const HasOne RelationshipType = "has_one" // HasOneRel has one relationship
const Int DataType = "int"
const Many2Many RelationshipType = "many_to_many" // Many2ManyRel many to many relationship
func Parse(dest interface{}, cacheStore *sync.Map, namer Namer) (*Schema, error) get data type from dialector
const String DataType = "string"
const Time DataType = "time"
func ToQueryValues(table string, foreignKeys []string, foreignValues [][]interface{}) (interface{}, []interface{}) ToQueryValues to query values
const Uint DataType = "uint"
const UnixSecond TimeType = 1