Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 61 for Kappen (0.15 sec)

  1. tests/preload_test.go

    		}
    	}
    
    	if err := DB.Create(&users).Error; err != nil {
    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	var userIDs []uint
    	for _, user := range users {
    		userIDs = append(userIDs, user.ID)
    	}
    
    	var users2 []User
    	DB.Preload("Pets.Toy").Find(&users2, "id IN ?", userIDs)
    
    	for idx, user := range users2 {
    		CheckUser(t, user, users[idx])
    	}
    }
    
    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)
  2. tests/associations_many2many_test.go

    	languages := []Language{
    		{Code: "language-many2many-append-1-1", Name: "language-many2many-append-1-1"},
    		{Code: "language-many2many-append-2-1", Name: "language-many2many-append-2-1"},
    	}
    	DB.Create(&languages)
    
    	if err := DB.Model(&user2).Association("Languages").Append(&languages); err != nil {
    		t.Fatalf("Error happened when append language, got %v", err)
    	}
    
    	user.Languages = append(user.Languages, languages...)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 13.2K bytes
    - Viewed (0)
  3. schema/relationship.go

    		case HasOne:
    			schema.Relationships.HasOne = append(schema.Relationships.HasOne, relation)
    		case HasMany:
    			schema.Relationships.HasMany = append(schema.Relationships.HasMany, relation)
    		case BelongsTo:
    			schema.Relationships.BelongsTo = append(schema.Relationships.BelongsTo, relation)
    		case Many2Many:
    			schema.Relationships.Many2Many = append(schema.Relationships.Many2Many, relation)
    		}
    	}
    
    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)
  4. association.go

    					if ref.OwnPrimaryKey {
    						primaryFields = append(primaryFields, ref.PrimaryKey)
    						joinPrimaryKeys = append(joinPrimaryKeys, ref.ForeignKey.DBName)
    					} else {
    						relPrimaryFields = append(relPrimaryFields, ref.PrimaryKey)
    						joinRelPrimaryKeys = append(joinRelPrimaryKeys, ref.ForeignKey.DBName)
    					}
    				} else {
    					conds = append(conds, clause.Eq{Column: ref.ForeignKey.DBName, Value: ref.PrimaryValue})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu May 04 11:30:45 GMT 2023
    - 21.2K bytes
    - Viewed (0)
  5. schema/schema.go

    				field.Schema.CreateClauses = append(field.Schema.CreateClauses, fc.CreateClauses(field)...)
    			}
    
    			if fc, ok := fieldInterface.(QueryClausesInterface); ok {
    				field.Schema.QueryClauses = append(field.Schema.QueryClauses, fc.QueryClauses(field)...)
    			}
    
    			if fc, ok := fieldInterface.(UpdateClausesInterface); ok {
    				field.Schema.UpdateClauses = append(field.Schema.UpdateClauses, fc.UpdateClauses(field)...)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 06:50:29 GMT 2023
    - 13.7K bytes
    - Viewed (0)
  6. tests/non_std_test.go

    	UpdatedAt  time.Time
    }
    
    func TestNonStdPrimaryKeyAndDefaultValues(t *testing.T) {
    	DB.Migrator().DropTable(&Animal{})
    	if err := DB.AutoMigrate(&Animal{}); err != nil {
    		t.Fatalf("no error should happen when migrate but got %v", err)
    	}
    
    	animal := Animal{Name: "Ferdinand"}
    	DB.Save(&animal)
    	updatedAt1 := animal.UpdatedAt
    
    	DB.Save(&animal).Update("name", "Francis")
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  7. clause/group_by.go

    	if v, ok := clause.Expression.(GroupBy); ok {
    		copiedColumns := make([]Column, len(v.Columns))
    		copy(copiedColumns, v.Columns)
    		groupBy.Columns = append(copiedColumns, groupBy.Columns...)
    
    		copiedHaving := make([]Expression, len(v.Having))
    		copy(copiedHaving, v.Having)
    		groupBy.Having = append(copiedHaving, groupBy.Having...)
    	}
    	clause.Expression = groupBy
    
    	if len(groupBy.Columns) == 0 {
    		clause.Name = ""
    	} else {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 30 10:28:09 GMT 2021
    - 1K bytes
    - Viewed (0)
  8. clause/clause_test.go

    		stmt          = gorm.Statement{DB: db, Table: user.Table, Schema: user, Clauses: map[string]clause.Clause{}}
    	)
    
    	for _, c := range clauses {
    		if _, ok := buildNamesMap[c.Name()]; !ok {
    			buildNames = append(buildNames, c.Name())
    			buildNamesMap[c.Name()] = true
    		}
    
    		stmt.AddClause(c)
    	}
    
    	stmt.Build(buildNames...)
    
    	if strings.TrimSpace(stmt.SQL.String()) != result {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Jun 02 02:50:38 GMT 2020
    - 1012 bytes
    - Viewed (0)
  9. schema/field.go

    				ef.BindNames = append([]string{fieldStruct.Name}, ef.BindNames...)
    				if _, ok := field.TagSettings["EMBEDDED"]; ok || !fieldStruct.Anonymous {
    					ef.EmbeddedBindNames = append([]string{fieldStruct.Name}, ef.EmbeddedBindNames...)
    				}
    				// index is negative means is pointer
    				if field.FieldType.Kind() == reflect.Struct {
    					ef.StructField.Index = append([]int{fieldStruct.Index[0]}, ef.StructField.Index...)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 15 03:20:20 GMT 2024
    - 32K bytes
    - Viewed (1)
  10. tests/sql_builder_test.go

    	DB.Save(&user1).Save(&user2).Save(&user3)
    
    	rows, err := DB.Table("users").Where("name = ? or name = ?", user2.Name, user3.Name).Select("name, age").Rows()
    	if err != nil {
    		t.Errorf("Not error should happen, got %v", err)
    	}
    
    	count := 0
    	for rows.Next() {
    		var name string
    		var age int64
    		rows.Scan(&name, &age)
    		count++
    	}
    
    	if count != 2 {
    		t.Errorf("Should found two records")
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
Back to top