- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 47 for field1 (0.14 sec)
-
tests/migrate_test.go
} _ = stmt.Schema.ParseIndexes() field := stmt.Schema.LookUpField(fieldName) if field == nil { t.Fatalf("%v: failed to find column %q", utils.FileWithLineNum(), fieldName) } if field.Unique != unique { t.Fatalf("%v: %q column %q unique should be %v but got %v", utils.FileWithLineNum(), stmt.Schema.Table, fieldName, unique, field.Unique) } if field.UniqueIndex != uniqueIndex {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Mar 18 11:24:16 GMT 2024 - 56.2K bytes - Viewed (0) -
scan.go
mapValue[column] = nil } } } func (db *DB) scanIntoStruct(rows Rows, reflectValue reflect.Value, values []interface{}, fields []*schema.Field, joinFields [][]*schema.Field) { for idx, field := range fields { if field != nil { values[idx] = field.NewValuePool.Get() } else if len(fields) == 1 { if reflectValue.CanAddr() { values[idx] = reflectValue.Addr().Interface() } else {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Apr 26 09:53:11 GMT 2024 - 9.8K bytes - Viewed (0) -
schema/constraint.go
} // ParseUniqueConstraints parse schema unique constraints func (schema *Schema) ParseUniqueConstraints() map[string]UniqueConstraint { uniques := make(map[string]UniqueConstraint) for _, field := range schema.Fields { if field.Unique { name := schema.namer.UniqueName(schema.Table, field.DBName) uniques[name] = UniqueConstraint{Name: name, Field: field} } } return uniques
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Mar 18 07:33:54 GMT 2024 - 1.9K bytes - Viewed (0) -
schema/serializer.go
Value(ctx context.Context, field *Field, dst reflect.Value, fieldValue interface{}) (interface{}, error) } // JSONSerializer json serializer type JSONSerializer struct{} // Scan implements serializer interface func (JSONSerializer) Scan(ctx context.Context, field *Field, dst reflect.Value, dbValue interface{}) (err error) { fieldValue := reflect.New(field.FieldType) if dbValue != nil { var bytes []byte
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Mar 18 08:28:46 GMT 2024 - 4.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) {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Thu Oct 26 03:58:13 GMT 2023 - 7.3K bytes - Viewed (0) -
tests/joins_test.go
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Wed Apr 26 14:19:32 GMT 2023 - 13.5K bytes - Viewed (1) -
schema/relationship_test.go
} if createdByRel, ok := userSchema.Relationships.Relations["CreatedBy"]; ok { if createdByRel.FieldSchema != userSchema { t.Fatalf("expects same field schema, but got new %p, old %p", createdByRel.FieldSchema, userSchema) } } else { t.Fatalf("expects created by relations, but not found") } } func TestEmbeddedHas(t *testing.T) { type Toy struct {
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Mon Apr 15 03:20:20 GMT 2024 - 25.5K bytes - Viewed (0) -
tests/create_test.go
err := DB.Create(&jt).Error if err != nil { t.Errorf("No error should happen when create a record without a GORM primary key. But in the database this primary key exists and is the union of 2 or more fields\n But got: %s", err) } } func TestSelectWithCreate(t *testing.T) { user := *GetUser("select_create", Config{Account: true, Pets: 3, Toys: 3, Company: true, Manager: true, Team: 3, Languages: 3, Friends: 4})
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Mar 19 03:50:28 GMT 2024 - 26.4K bytes - Viewed (0) -
schema/schema_helper_test.go
} } for _, name := range []string{f.DBName, f.Name} { if name != "" { if field := s.LookUpField(name); field == nil || (field.Name != name && field.DBName != name) { t.Errorf("schema %v failed to look up field with dbname %v", s, f.DBName) } } } if f.PrimaryKey { var found bool
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Dec 15 08:31:23 GMT 2023 - 7.5K bytes - Viewed (0) -
callbacks/associations.go
obj := db.Statement.ReflectValue.Index(i) if reflect.Indirect(obj).Kind() != reflect.Struct { break } if _, zero := rel.Field.ValueOf(db.Statement.Context, obj); !zero { // check belongs to relation value rv := rel.Field.ReflectValueOf(db.Statement.Context, obj) // relation reflect value if !isPtr { rv = rv.Addr() } objs = append(objs, obj)
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Tue Apr 11 03:06:13 GMT 2023 - 14.3K bytes - Viewed (0)