Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 35 for join (0.14 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 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  2. clause/from.go

    	}
    
    	for _, join := range from.Joins {
    		builder.WriteByte(' ')
    		join.Build(builder)
    	}
    }
    
    // MergeClause merge from clause
    func (from From) MergeClause(clause *Clause) {
    	clause.Expression = from
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jul 15 02:25:10 GMT 2020
    - 630 bytes
    - Viewed (0)
  3. tests/distinct_test.go

    	}
    
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    	r := dryDB.Distinct("u.id, u.*").Table("user_speaks as s").Joins("inner join users as u on u.id = s.user_id").Where("s.language_code ='US' or s.language_code ='ES'").Find(&User{})
    	if !regexp.MustCompile(`SELECT DISTINCT u\.id, u\.\* FROM user_speaks as s inner join users as u`).MatchString(r.Statement.SQL.String()) {
    		t.Fatalf("Build Distinct with u.*, but got %v", r.Statement.SQL.String())
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  4. clause/joins.go

    	RightJoin JoinType = "RIGHT"
    )
    
    // Join clause for from
    type Join struct {
    	Type       JoinType
    	Table      Table
    	ON         Where
    	Using      []string
    	Expression Expression
    }
    
    func (join Join) Build(builder Builder) {
    	if join.Expression != nil {
    		join.Expression.Build(builder)
    	} else {
    		if join.Type != "" {
    			builder.WriteString(string(join.Type))
    			builder.WriteByte(' ')
    		}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Nov 03 13:03:13 GMT 2022
    - 901 bytes
    - Viewed (0)
  5. 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)
    				}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 7.5K bytes
    - Viewed (0)
  6. utils/utils.go

    		default:
    			results[idx] = "nil"
    			vv := reflect.ValueOf(v)
    			if vv.IsValid() && !vv.IsZero() {
    				results[idx] = fmt.Sprint(reflect.Indirect(vv).Interface())
    			}
    		}
    	}
    
    	return strings.Join(results, "_")
    }
    
    func Contains(elems []string, elem string) bool {
    	for _, e := range elems {
    		if elem == e {
    			return true
    		}
    	}
    	return false
    }
    
    func AssertEqual(x, y interface{}) bool {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  7. 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...)
    }
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  8. clause/joins_test.go

    			name: "RIGHT JOIN",
    			join: clause.Join{
    				Type:  clause.RightJoin,
    				Table: clause.Table{Name: "user"},
    				ON: clause.Where{
    					Exprs: []clause.Expression{clause.Eq{clause.Column{Table: "user_info", Name: "user_id"}, clause.PrimaryColumn}},
    				},
    			},
    			sql: "RIGHT JOIN `user` ON `user_info`.`user_id` = `users`.`id`",
    		},
    		{
    			name: "INNER JOIN",
    			join: clause.Join{
    				Type:  clause.InnerJoin,
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Nov 03 13:03:13 GMT 2022
    - 2.6K bytes
    - Viewed (0)
  9. 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 {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  10. clause/from_test.go

    					Joins: []clause.Join{
    						{
    							Type:  clause.RightJoin,
    							Table: clause.Table{Name: "profiles"},
    							ON: clause.Where{
    								[]clause.Expression{clause.Eq{clause.Column{Table: "profiles", Name: "email"}, clause.Column{Table: clause.CurrentTable, Name: "email"}}},
    							},
    						},
    					},
    				}, clause.From{
    					Joins: []clause.Join{
    						{
    							Type:  clause.InnerJoin,
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jul 15 02:25:10 GMT 2020
    - 1.9K bytes
    - Viewed (0)
Back to top