Versions in this module Expand all Collapse all v1 v1.24.4 Nov 15, 2022 v1.24.3 Nov 15, 2022 Changes in this version + var ByteReflectType = reflect.TypeOf(uint8(0)) + var ErrUnsupportedDataType = errors.New("unsupported data type") + var TimePtrReflectType = reflect.TypeOf(&time.Time{}) + var TimeReflectType = reflect.TypeOf(time.Time{}) + func GetIdentityFieldValuesMap(ctx context.Context, reflectValue reflect.Value, fields []*Field) (map[string][]reflect.Value, [][]interface{}) + func GetIdentityFieldValuesMapFromValues(ctx context.Context, values []interface{}, fields []*Field) (map[string][]reflect.Value, [][]interface{}) + func GetRelationsValues(ctx context.Context, reflectValue reflect.Value, rels []*Relationship) (reflectResults reflect.Value) + func ParseTagSetting(str string, sep string) map[string]string + func RegisterSerializer(name string, serializer SerializerInterface) + func ToQueryValues(table string, foreignKeys []string, foreignValues [][]interface{}) (interface{}, []interface{}) + type Check struct + Constraint string + Name string + type Constraint struct + Field *Field + ForeignKeys []*Field + Name string + OnDelete string + OnUpdate string + ReferenceSchema *Schema + References []*Field + Schema *Schema + type CreateClausesInterface interface + CreateClauses func(*Field) []clause.Interface + type DataType string + const Bool + const Bytes + const Float + const Int + const String + const Time + const Uint + type DeleteClausesInterface interface + DeleteClauses func(*Field) []clause.Interface + type Field struct + AutoCreateTime TimeType + AutoIncrement bool + AutoIncrementIncrement int64 + 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 + IgnoreMigration bool + IndirectFieldType reflect.Type + Name string + NewValuePool FieldNewValuePool + NotNull bool + OwnerSchema *Schema + Precision int + PrimaryKey bool + Readable bool + ReflectValueOf func(context.Context, reflect.Value) reflect.Value + Scale int + Schema *Schema + Serializer SerializerInterface + Set func(context.Context, reflect.Value, interface{}) error + Size int + StructField reflect.StructField + Tag reflect.StructTag + TagSettings map[string]string + Unique bool + Updatable bool + ValueOf func(context.Context, reflect.Value) (value interface{}, zero bool) + type FieldNewValuePool interface + Get func() interface{} + Put func(interface{}) + type GobSerializer struct + func (GobSerializer) Scan(ctx context.Context, field *Field, dst reflect.Value, dbValue interface{}) (err error) + func (GobSerializer) Value(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (interface{}, error) + type GormDataTypeInterface interface + GormDataType func() string + type Index struct + Class string + Comment string + Fields []IndexOption + Name string + Option string + Type string + Where string + type IndexOption struct + Collate string + Expression string + Length int + Sort string + type JSONSerializer struct + func (JSONSerializer) Scan(ctx context.Context, field *Field, dst reflect.Value, dbValue interface{}) (err error) + func (JSONSerializer) Value(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (interface{}, error) + type Namer interface + CheckerName func(table, column string) string + ColumnName func(table, column string) string + IndexName func(table, column string) string + JoinTableName func(joinTable string) string + RelationshipFKName func(Relationship) string + SchemaName func(table string) string + TableName func(table string) string + type NamingStrategy struct + NameReplacer Replacer + NoLowerCase bool + SingularTable bool + TablePrefix string + func (ns NamingStrategy) CheckerName(table, column string) string + func (ns NamingStrategy) ColumnName(table, column string) string + func (ns NamingStrategy) IndexName(table, column string) string + func (ns NamingStrategy) JoinTableName(str string) string + func (ns NamingStrategy) RelationshipFKName(rel Relationship) string + func (ns NamingStrategy) SchemaName(table string) string + func (ns NamingStrategy) TableName(str string) string + type Polymorphic struct + PolymorphicID *Field + PolymorphicType *Field + Value string + type QueryClausesInterface interface + QueryClauses func(*Field) []clause.Interface + type Reference struct + ForeignKey *Field + OwnPrimaryKey bool + PrimaryKey *Field + PrimaryValue string + type Relationship struct + Field *Field + FieldSchema *Schema + JoinTable *Schema + Name string + Polymorphic *Polymorphic + References []*Reference + Schema *Schema + Type RelationshipType + func (rel *Relationship) ParseConstraint() *Constraint + func (rel *Relationship) ToQueryConditions(ctx context.Context, reflectValue reflect.Value) (conds []clause.Expression) + type RelationshipType string + const BelongsTo + const HasMany + const HasOne + const Many2Many + type Relationships struct + BelongsTo []*Relationship + HasMany []*Relationship + HasOne []*Relationship + Many2Many []*Relationship + Relations map[string]*Relationship + type Replacer interface + Replace func(name string) string + type Schema struct + AfterCreate bool + AfterDelete bool + AfterFind bool + AfterSave bool + AfterUpdate bool + BeforeCreate bool + BeforeDelete bool + BeforeSave bool + BeforeUpdate bool + CreateClauses []clause.Interface + DBNames []string + DeleteClauses []clause.Interface + Fields []*Field + FieldsByDBName map[string]*Field + FieldsByName map[string]*Field + FieldsWithDefaultDBValue []*Field + ModelType reflect.Type + Name string + PrimaryFieldDBNames []string + PrimaryFields []*Field + PrioritizedPrimaryField *Field + QueryClauses []clause.Interface + Relationships Relationships + Table string + UpdateClauses []clause.Interface + func Parse(dest interface{}, cacheStore *sync.Map, namer Namer) (*Schema, error) + func ParseWithSpecialTableName(dest interface{}, cacheStore *sync.Map, namer Namer, specialTableName string) (*Schema, error) + func (schema *Schema) LookIndex(name string) *Index + func (schema *Schema) ParseCheckConstraints() map[string]Check + func (schema *Schema) ParseField(fieldStruct reflect.StructField) *Field + func (schema *Schema) ParseIndexes() map[string]Index + func (schema Schema) LookUpField(name string) *Field + func (schema Schema) MakeSlice() reflect.Value + func (schema Schema) String() string + type SerializerInterface interface + Scan func(ctx context.Context, field *Field, dst reflect.Value, dbValue interface{}) error + func GetSerializer(name string) (serializer SerializerInterface, ok bool) + type SerializerValuerInterface interface + Value func(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (interface{}, error) + type Tabler interface + TableName func() string + type TablerWithNamer interface + TableName func(Namer) string + type TimeType int64 + const UnixMillisecond + const UnixNanosecond + const UnixSecond + const UnixTime + type UnixSecondSerializer struct + func (UnixSecondSerializer) Scan(ctx context.Context, field *Field, dst reflect.Value, dbValue interface{}) (err error) + func (UnixSecondSerializer) Value(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (result interface{}, err error) + type UpdateClausesInterface interface + UpdateClauses func(*Field) []clause.Interface