- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for primaryFields (0.2 sec)
-
callbacks/update.go
for i := 0; i < size; i++ { for _, field := range stmt.Schema.PrimaryFields { _, isZero = field.ValueOf(stmt.Context, stmt.ReflectValue.Index(i)) if !isZero { break } } } if !isZero { _, primaryValues := schema.GetIdentityFieldValuesMap(stmt.Context, stmt.ReflectValue, stmt.Schema.PrimaryFields)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Mar 18 05:44:55 UTC 2024 - 9.4K bytes - Viewed (0) -
schema/schema_helper_test.go
"gorm.io/gorm/utils/tests" ) func checkSchema(t *testing.T, s *schema.Schema, v schema.Schema, primaryFields []string) { t.Run("CheckSchema/"+s.Name, func(t *testing.T) { tests.AssertObjEqual(t, s, v, "Name", "Table") for idx, field := range primaryFields { var found bool for _, f := range s.PrimaryFields { if f.Name == field { found = true } } if idx == 0 {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Dec 15 08:31:23 UTC 2023 - 7.5K bytes - Viewed (0) -
soft_delete.go
stmt.SetColumn(sd.Field.DBName, curTime, true) if stmt.Schema != nil { _, queryValues := schema.GetIdentityFieldValuesMap(stmt.Context, stmt.ReflectValue, stmt.Schema.PrimaryFields) column, values := schema.ToQueryValues(stmt.Table, stmt.Schema.PrimaryFieldDBNames, queryValues) if len(values) > 0 {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Feb 01 06:40:55 UTC 2023 - 4.5K bytes - Viewed (1) -
callbacks/delete.go
db.Statement.AddClauseIfNotExists(clause.Delete{}) if db.Statement.Schema != nil { _, queryValues := schema.GetIdentityFieldValuesMap(db.Statement.Context, db.Statement.ReflectValue, db.Statement.Schema.PrimaryFields) column, values := schema.ToQueryValues(db.Statement.Table, db.Statement.Schema.PrimaryFieldDBNames, queryValues) if len(values) > 0 {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Feb 25 02:48:23 UTC 2022 - 5.6K bytes - Viewed (0) -
tests/embedded_struct_test.go
stmt := gorm.Statement{DB: DB} if err := stmt.Parse(&EngadgetPost{}); err != nil { t.Fatalf("failed to parse embedded struct") } else if len(stmt.Schema.PrimaryFields) != 1 { t.Errorf("should have only one primary field with embedded struct, but got %v", len(stmt.Schema.PrimaryFields)) } for _, name := range []string{"user_id", "user_name", "user_email"} { if !DB.Migrator().HasColumn(&HNPost{}, name) {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed May 08 04:07:58 UTC 2024 - 7.3K bytes - Viewed (0)