Versions in this module Expand all Collapse all v1 v1.0.3 Aug 16, 2021 v1.0.2 Aug 16, 2021 v1.0.1 Aug 14, 2021 Changes in this version + var ErrUnsupportedDataType = errors.New("unsupported data type") + var TimeReflectType = reflect.TypeOf(time.Time{}) + func GetIdentityFieldValuesMap(reflectValue reflect.Value, fields []*Field) (map[string][]reflect.Value, [][]interface{}) + func GetIdentityFieldValuesMapFromValues(values []interface{}, fields []*Field) (map[string][]reflect.Value, [][]interface{}) + func GetRelationsValues(reflectValue reflect.Value, rels []*Relationship) (reflectResults reflect.Value) + func ParseTagSetting(str string, sep string) map[string]string + 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 + 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) + 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 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(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 (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 Tabler interface + TableName func() string + type TimeType int64 + const UnixMillisecond + const UnixNanosecond + const UnixSecond + type UpdateClausesInterface interface + UpdateClauses func(*Field) []clause.Interface