- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 103 for Struct (0.05 sec)
-
tests/preload_suits_test.go
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Thu Jun 05 11:34:13 UTC 2025 - 30.4K bytes - Viewed (0) -
schema/relationship_test.go
}) } func TestEmbeddedBelongsTo(t *testing.T) { type Country struct { ID int `gorm:"primaryKey"` Name string } type Address struct { CountryID int Country Country } type NestedAddress struct { Address } type CountryMixin struct { CountryID int Country Country } type Org struct { ID int
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Mon Aug 18 11:44:52 UTC 2025 - 26.5K bytes - Viewed (0) -
tests/scanner_valuer_test.go
} type NullString struct { sql.NullString } type Point struct { X, Y int } func (point Point) GormDataType() string { return "geo" } func (point Point) GormValue(ctx context.Context, db *gorm.DB) clause.Expr { return clause.Expr{ SQL: "ST_PointFromText(?)",Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Wed Jun 07 07:02:07 UTC 2023 - 10.6K bytes - Viewed (0) -
tests/scan_test.go
t.Errorf("No error should happen, got %v", err) } type NestedEmbeddedStruct struct { NestedEmbeddedIntField int NestedEmbeddedIntFieldWithDefault int `gorm:"default:2"` } type EmbeddedStruct struct { EmbeddedIntField int NestedEmbeddedStruct `gorm:"embedded"` } type EmbeddedPtrStruct struct { EmbeddedPtrIntField int *NestedEmbeddedStruct `gorm:"embedded"` }
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Wed Jun 12 10:57:36 UTC 2024 - 10.9K bytes - Viewed (0) -
schema/schema_test.go
f.Readable = true }) } } func TestEmbeddedStruct(t *testing.T) { type CorpBase struct { gorm.Model OwnerID string } type Company struct { ID int OwnerID int Name string Ignored string `gorm:"-"` } type Corp struct { CorpBase Base Company `gorm:"embedded;embeddedPrefix:company_"` }
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Thu Aug 28 02:57:17 UTC 2025 - 13.3K bytes - Viewed (0) -
tests/preload_test.go
func TestNestedPreloadWithNestedJoin(t *testing.T) { type ( Preload struct { ID uint Value string NestedID uint } Join struct { ID uint Value string NestedID uint } Nested struct { ID uint Preloads []*Preload Join Join ValueID uint } Value struct { ID uint Name string Nested Nested } )
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Wed Jun 12 10:00:47 UTC 2024 - 15.9K bytes - Viewed (0) -
tests/associations_test.go
// do nothing } func TestAssociationEmptyQueryClause(t *testing.T) { type Organization struct { gorm.Model Name string } type Region struct { gorm.Model Name string Organizations []Organization `gorm:"many2many:region_orgs;"` } type RegionOrg struct { RegionId uint OrganizationId uint Empty myType }
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Sep 12 04:33:27 UTC 2025 - 13.3K bytes - Viewed (0) -
schema/schema.go
if field, ok := schema.FieldsByDBName[namerColumnName]; ok { return field } return nil } // LookUpFieldByBindName looks for the closest field in the embedded struct. // // type Struct struct { // Embedded struct { // ID string // is selected by LookUpFieldByBindName([]string{"Embedded", "ID"}, "ID") // } // ID string // is selected by LookUpFieldByBindName([]string{"ID"}, "ID") // }
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Fri Oct 31 12:13:56 UTC 2025 - 13.1K bytes - Viewed (0) -
schema/relationship.go
} } } // User has many Toys, its `Polymorphic` is `Owner`, Pet has one Toy, its `Polymorphic` is `Owner` // // type User struct { // Toys []Toy `gorm:"polymorphic:Owner;"` // } // type Pet struct { // Toy Toy `gorm:"polymorphic:Owner;"` // } // type Toy struct { // OwnerID int // OwnerType string // } func (schema *Schema) buildPolymorphicRelation(relation *Relationship, field *Field) {Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Sun Nov 16 04:11:05 UTC 2025 - 23.1K bytes - Viewed (1) -
callbacks/associations.go
for i := 0; i < db.Statement.ReflectValue.Len(); i++ { obj := db.Statement.ReflectValue.Index(i) if reflect.Indirect(obj).Kind() == reflect.Struct { appendToElems(obj) } } case reflect.Struct: appendToElems(db.Statement.ReflectValue) } if elems.Len() > 0 { assignmentColumns := make([]string, 0, len(rel.References))
Registered: Sun Dec 28 09:35:17 UTC 2025 - Last Modified: Thu Feb 13 06:16:26 UTC 2025 - 14.4K bytes - Viewed (0)