- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for FieldsByDBName (0.05 sec)
-
schema/schema.go
if v, ok := schema.FieldsByDBName[field.DBName]; !ok || ((field.Creatable || field.Updatable || field.Readable) && len(field.BindNames) < len(v.BindNames)) { if _, ok := schema.FieldsByDBName[field.DBName]; !ok { schema.DBNames = append(schema.DBNames, field.DBName) } schema.FieldsByDBName[field.DBName] = field schema.FieldsByName[field.Name] = field
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Aug 19 06:35:49 UTC 2025 - 12.9K bytes - Viewed (0) -
schema/field_test.go
"created_at": time.Now(), "updated_at": nil, "deleted_at": time.Now(), "age": 20, "birthday": time.Now(), "active": f, } for k, v := range newValues { if err := userSchema.FieldsByDBName[k].Set(context.Background(), reflectValue, v); err != nil { t.Errorf("no error should happen when assign value to field %v, but got %v", k, err) } } newValues["updated_at"] = time.Time{}
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sat Feb 19 09:02:53 UTC 2022 - 12.7K bytes - Viewed (0) -
callbacks/create.go
) stmt.Settings.Delete("gorm:update_track_time") values = clause.Values{Columns: make([]clause.Column, 0, len(stmt.Schema.DBNames))} for _, db := range stmt.Schema.DBNames { if field := stmt.Schema.FieldsByDBName[db]; !field.HasDefaultValue || field.DefaultValueInterface != nil { if v, ok := selectColumns[db]; (ok && v) || (!ok && (!restricted || field.AutoCreateTime > 0 || field.AutoUpdateTime > 0)) {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Jul 29 11:06:13 UTC 2025 - 13K bytes - Viewed (0) -
migrator/migrator.go
// not found, add column if err = execTx.Migrator().AddColumn(value, dbName); err != nil { return err } } else { // found, smartly migrate field := stmt.Schema.FieldsByDBName[dbName] if err = execTx.Migrator().MigrateColumn(value, field, foundColumn); err != nil { return err } } }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Fri Jun 06 02:35:01 UTC 2025 - 29.5K bytes - Viewed (0) -
statement.go
} return !zero && !utils.AssertEqual(changedValue, fieldValue) } } } } return false } if len(fields) == 0 { for _, field := range stmt.Schema.FieldsByDBName { if changed(field) { return true } } } else { for _, name := range fields { if field := stmt.Schema.LookUpField(name); field != nil { if changed(field) { return true
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 20.8K bytes - Viewed (0)