Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for JoinTable (0.05 sec)

  1. 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 Dec 28 09:35:17 UTC 2025
    - Last Modified: Sun Nov 16 04:11:05 UTC 2025
    - 23.1K bytes
    - Viewed (1)
  2. 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 Dec 28 09:35:17 UTC 2025
    - Last Modified: Sun Oct 26 12:09:12 UTC 2025
    - 23.6K bytes
    - Viewed (0)
  3. 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 Dec 28 09:35:17 UTC 2025
    - Last Modified: Sun Nov 02 14:09:18 UTC 2025
    - 25.9K bytes
    - Viewed (0)
  4. 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 Dec 28 09:35:17 UTC 2025
    - Last Modified: Sun Nov 02 14:09:18 UTC 2025
    - 33.7K bytes
    - Viewed (0)
  5. migrator/migrator.go

    	}
    
    	getTable := func(rel *schema.Relationship) string {
    		switch rel.Type {
    		case schema.HasOne, schema.HasMany:
    			return rel.FieldSchema.Table
    		case schema.Many2Many:
    			return rel.JoinTable.Table
    		}
    		return stmt.Table
    	}
    
    	for _, rel := range stmt.Schema.Relationships.Relations {
    		if constraint := rel.ParseConstraint(); constraint != nil && constraint.Name == name {
    Registered: Sun Dec 28 09:35:17 UTC 2025
    - Last Modified: Sun Oct 26 12:31:09 UTC 2025
    - 29.7K bytes
    - Viewed (0)
Back to top