Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for ID (0.14 sec)

  1. schema/relationship_test.go

    		LocaleTags []Tag `gorm:"many2many:locale_blog_tags;ForeignKey:id,locale;References:id"`
    	}
    
    	checkStructRelation(t, &Blog{},
    		Relation{
    			Name: "Tags", Type: schema.Many2Many, Schema: "Blog", FieldSchema: "Tag",
    			JoinTable: JoinTable{Name: "blog_tags", Table: "blog_tags"},
    			References: []Reference{
    				{"ID", "Blog", "BlogID", "blog_tags", "", true},
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 25.5K bytes
    - Viewed (0)
  2. 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 May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  3. clause/where_test.go

    			}},
    			"SELECT * FROM `users` WHERE `users`.`id` = ? OR `name` <> ? AND `age` > ?",
    			[]interface{}{"1", "jinzhu", 18},
    		},
    		{
    			[]clause.Interface{clause.Select{}, clause.From{}, clause.Where{
    				Exprs: []clause.Expression{clause.Or(clause.Eq{Column: clause.PrimaryColumn, Value: "1"}), clause.Or(clause.Neq{Column: "name", Value: "jinzhu"})},
    			}},
    			"SELECT * FROM `users` WHERE `users`.`id` = ? OR `name` <> ?",
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  4. tests/preload_test.go

    	}
    
    	var user2 User
    	DB.Preload("Pets.Toy").Find(&user2, "id = ?", user.ID)
    	CheckUser(t, user2, user)
    
    	var user3 User
    	DB.Preload(clause.Associations+"."+clause.Associations).Find(&user3, "id = ?", user.ID)
    	CheckUser(t, user3, user)
    
    	var user4 *User
    	DB.Preload("Pets.Toy").Find(&user4, "id = ?", user.ID)
    	CheckUser(t, *user4, user)
    }
    
    func TestNestedPreloadForSlice(t *testing.T) {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:21:03 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  5. tests/query_test.go

    		}
    	}
    
    	for idx, id := range ids {
    		if int(id) != int(users[idx].ID) {
    			t.Errorf("Unexpected result on pluck id, got %+v", ids)
    		}
    	}
    
    	for idx, id := range ids2 {
    		if int(id) != int(users[idx].ID+1) {
    			t.Errorf("Unexpected result on pluck id, got %+v", ids)
    		}
    	}
    
    	var times []time.Time
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
  6. schema/relationship.go

    			if len(primaryFields) == 1 {
    				lookUpNames = append(lookUpNames, strings.TrimSuffix(lookUpName, primaryField.Name)+"ID",
    					strings.TrimSuffix(lookUpName, primaryField.Name)+"Id", schema.namer.ColumnName(foreignSchema.Table,
    						strings.TrimSuffix(lookUpName, primaryField.Name)+"ID"))
    			}
    
    			for _, name := range lookUpNames {
    				if f := foreignSchema.LookUpFieldByBindName(field.BindNames, name); f != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 22.4K bytes
    - Viewed (0)
Back to top