Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 11 for joina (0.82 sec)

  1. callbacks/query.go

    							}
    						}
    					} else {
    						fromClause.Joins = append(fromClause.Joins, clause.Join{
    							Expression: clause.NamedExpr{SQL: join.Name, Vars: join.Conds},
    						})
    					}
    				} else {
    					fromClause.Joins = append(fromClause.Joins, clause.Join{
    						Expression: clause.NamedExpr{SQL: join.Name, Vars: join.Conds},
    					})
    				}
    			}
    
    			db.Statement.AddClause(fromClause)
    		} else {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 09:51:44 UTC 2024
    - 10.1K bytes
    - Viewed (0)
  2. schema/relationship.go

    	relation.Type = Many2Many
    
    	var (
    		err             error
    		joinTableFields []reflect.StructField
    		fieldsMap       = map[string]*Field{}
    		ownFieldsMap    = map[string]*Field{} // fix self join many2many
    		referFieldsMap  = map[string]*Field{}
    		joinForeignKeys = toColumns(field.TagSettings["JOINFOREIGNKEY"])
    		joinReferences  = toColumns(field.TagSettings["JOINREFERENCES"])
    	)
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 03:46:59 UTC 2024
    - 22.7K bytes
    - Viewed (0)
  3. chainable_api.go

    	}
    	return
    }
    
    // Joins specify Joins conditions
    //
    //	db.Joins("Account").Find(&user)
    //	db.Joins("JOIN emails ON emails.user_id = users.id AND emails.email = ?", "******@****.***").Find(&user)
    //	db.Joins("Account", DB.Select("id").Where("user_id = users.id AND name = ?", "someName").Model(&Account{}))
    func (db *DB) Joins(query string, args ...interface{}) (tx *DB) {
    	return joins(db, clause.LeftJoin, query, args...)
    }
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 09:47:34 UTC 2024
    - 14.5K bytes
    - Viewed (0)
  4. association.go

    				tx.Clauses(clause.Expr{SQL: strings.Replace(joinStmt.SQL.String(), "WHERE ", "", 1), Vars: joinStmt.Vars})
    			}
    		}
    
    		tx = tx.Session(&Session{QueryFields: true}).Clauses(clause.From{Joins: []clause.Join{{
    			Table: clause.Table{Name: association.Relationship.JoinTable.Table},
    			ON:    clause.Where{Exprs: queryConds},
    		}}})
    	} else {
    		tx.Clauses(clause.Where{Exprs: queryConds})
    	}
    
    	return tx
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 21.5K bytes
    - Viewed (0)
  5. tests/joins_test.go

    					Name: "nested-joins-manager-namepet-1",
    					Toy: Toy{
    						Name: "nested-joins-manager-namepet-toy-1",
    					},
    				},
    			},
    			NamedPet: &Pet{Name: "nested-joins-namepet-1", Toy: Toy{Name: "nested-joins-namepet-toy-1"}},
    		},
    		{
    			Name:     "nested-joins-2",
    			Manager:  GetUser("nested-joins-manager-2", Config{Company: true, NamedPet: true}),
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 15K bytes
    - Viewed (0)
  6. tests/preload_test.go

    	value := Value{
    		Name: "value",
    		Nested: &Nested{
    			Join: Join{
    				Value: "j1",
    				Preload: Preload{
    					Value: "p1",
    				},
    			},
    		},
    	}
    
    	if err := DB.Create(&value).Error; err != nil {
    		t.Errorf("failed to create value, got err: %v", err)
    	}
    
    	var find1 Value
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:00:47 UTC 2024
    - 15.9K bytes
    - Viewed (0)
  7. callbacks/preload.go

    	}
    	sort.Strings(preloadNames)
    
    	isJoined := func(name string) (joined bool, nestedJoins []string) {
    		for _, join := range joins {
    			if _, ok := relationships.Relations[join]; ok && name == join {
    				joined = true
    				continue
    			}
    			joinNames := strings.SplitN(join, ".", 2)
    			if len(joinNames) == 2 {
    				if _, ok := relationships.Relations[joinNames[0]]; ok && name == joinNames[0] {
    					joined = true
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 11.6K bytes
    - Viewed (0)
  8. scan.go

    			continue
    		}
    
    		if len(joinFields) == 0 || len(joinFields[idx]) == 0 {
    			db.AddError(field.Set(db.Statement.Context, reflectValue, values[idx]))
    		} else { // joinFields count is larger than 2 when using join
    			var isNilPtrValue bool
    			var relValue reflect.Value
    			// does not contain raw dbname
    			nestedJoinSchemas := joinFields[idx][:len(joinFields[idx])-1]
    			// current reflect value
    			currentReflectValue := reflectValue
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:57:36 UTC 2024
    - 10K bytes
    - Viewed (0)
  9. tests/scan_test.go

    	if err := DB.Select("people.*, addresses.*").
    		Table("people").
    		Joins("inner join person_addresses on people.id = person_addresses.person_id").
    		Joins("inner join addresses on person_addresses.address_id = addresses.id").
    		Find(&personAddressInfoList).Error; err != nil {
    		t.Errorf("Failed to run join query, got error: %v", err)
    	}
    
    	personMatched := false
    	addressMatched := false
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:57:36 UTC 2024
    - 10.9K bytes
    - Viewed (0)
  10. schema/naming.go

    }
    
    // ColumnName convert string to column name
    func (ns NamingStrategy) ColumnName(table, column string) string {
    	return ns.toDBName(column)
    }
    
    // JoinTableName convert string to join table name
    func (ns NamingStrategy) JoinTableName(str string) string {
    	if !ns.NoLowerCase && strings.ToLower(str) == str {
    		return ns.TablePrefix + str
    	}
    
    	if ns.SingularTable {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 03:46:59 UTC 2024
    - 5.3K bytes
    - Viewed (0)
Back to top