- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 16 for JoinTable (0.29 sec)
-
schema/schema_helper_test.go
} } if r.JoinTable != nil { if r.JoinTable.Name != relation.JoinTable.Name { t.Errorf("schema %v relation's join table name expects %v, but got %v", s, relation.JoinTable.Name, r.JoinTable.Name) } if r.JoinTable.Table != relation.JoinTable.Table { t.Errorf("schema %v relation's join table tablename expects %v, but got %v", s, relation.JoinTable.Table, r.JoinTable.Table) }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Aug 28 02:57:17 UTC 2025 - 7.5K bytes - Viewed (0) -
schema/naming_test.go
if chkName != "chk_public_table_name" { t.Errorf("invalid checker name generated, got %v", chkName) } joinTable := ns.JoinTableName("user_languages") if joinTable != "public.user_languages" { t.Errorf("invalid join table generated, got %v", joinTable) } joinTable2 := ns.JoinTableName("UserLanguage") if joinTable2 != "public.user_language" {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue May 30 02:00:48 UTC 2023 - 7K bytes - Viewed (0) -
schema/relationship.go
Tag: `gorm:"-"`, }) if relation.JoinTable, err = Parse(reflect.New(reflect.StructOf(joinTableFields)).Interface(), schema.cacheStore, schema.namer); err != nil { schema.err = err } relation.JoinTable.Name = many2many relation.JoinTable.Table = schema.namer.JoinTableName(many2many) relation.JoinTable.PrimaryFields = make([]*Field, 0, len(relation.JoinTable.Fields)) relName := relation.Schema.Name
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Aug 18 11:44:52 UTC 2025 - 23.1K bytes - Viewed (1) -
association.go
) if association.Relationship.JoinTable != nil { if !tx.Statement.Unscoped && len(association.Relationship.JoinTable.QueryClauses) > 0 { joinStmt := Statement{DB: tx, Context: tx.Statement.Context, Schema: association.Relationship.JoinTable, Table: association.Relationship.JoinTable.Table, Clauses: map[string]clause.Clause{}} for _, queryClause := range association.Relationship.JoinTable.QueryClauses { joinStmt.AddClause(queryClause)
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Wed Jun 12 10:49:45 UTC 2024 - 21.5K bytes - Viewed (0) -
schema/relationship_test.go
JoinTable: JoinTable{Name: "user_profiles", Table: "user_profiles"}, References: []Reference{ {"Refer", "User", "UserReferID", "user_profiles", "", true}, {"UserRefer", "Profile", "ProfileRefer", "user_profiles", "", false}, }, }, Relation{ Name: "Profiles2", Type: schema.Many2Many, Schema: "User", FieldSchema: "Profile", JoinTable: JoinTable{Name: "user_profiles2", Table: "user_profiles2"},
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Mon Aug 18 11:44:52 UTC 2025 - 26.5K bytes - Viewed (0) -
tests/generics_test.go
} // Left JOIN + Alias WHERE result, err = db.Joins(clause.LeftJoin.Association("Company").As("t"), func(db gorm.JoinBuilder, joinTable clause.Table, curTable clause.Table) error { if joinTable.Name != "t" { t.Fatalf("Join table should be t, but got %v", joinTable.Name) } db.Where("?.name = ?", joinTable, u.Company.Name) return nil }).Where(map[string]any{"name": u.Name}).First(ctx) if err != nil {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 28K bytes - Viewed (0) -
callbacks/delete.go
foreignFields = make([]*schema.Field, 0, len(rel.References)) relForeignKeys = make([]string, 0, len(rel.References)) modelValue = reflect.New(rel.JoinTable.ModelType).Interface() table = rel.JoinTable.Table tx = db.Session(&gorm.Session{NewDB: true}).Model(modelValue).Table(table) ) for _, ref := range rel.References { if ref.OwnPrimaryKey {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Sun May 25 07:40:40 UTC 2025 - 5.8K bytes - Viewed (0) -
gorm.go
func (db *DB) SetupJoinTable(model interface{}, field string, joinTable interface{}) error { var ( tx = db.getInstance() stmt = tx.Statement modelSchema, joinSchema *schema.Schema ) err := stmt.Parse(model) if err != nil { return err } modelSchema = stmt.Schema err = stmt.Parse(joinTable) if err != nil { return err }
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Tue Aug 26 06:24:29 UTC 2025 - 12.8K bytes - Viewed (0) -
schema/schema_test.go
References: []Reference{{"ID", "User", "ManagerID", "User", "", true}}, }, { Name: "Languages", Type: schema.Many2Many, Schema: "User", FieldSchema: "Language", JoinTable: JoinTable{Name: "UserSpeak", Table: "user_speaks", Fields: []schema.Field{ { Name: "UserID", DBName: "user_id", BindNames: []string{"UserID"}, DataType: schema.Uint,
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Aug 28 02:57:17 UTC 2025 - 13.3K bytes - Viewed (0) -
generics.go
q.limitPerRecord = num return q } func (c chainG[T]) Joins(jt clause.JoinTarget, on func(db JoinBuilder, joinTable clause.Table, curTable clause.Table) error) ChainInterface[T] { return c.with(func(db *DB) *DB { if jt.Table == "" { jt.Table = clause.JoinTable(strings.Split(jt.Association, ".")...).Name } q := joinBuilder{db: db.Session(&Session{NewDB: true, Initialized: true}).Table(jt.Table)}
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 15.5K bytes - Viewed (0)