Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 20 for Kappen (1.76 sec)

  1. tests/associations_belongs_to_test.go

    	}
    
    	// Append
    	DB.Model(&users).Association("Company").Append(
    		&Company{Name: "company-slice-append-1"},
    		&Company{Name: "company-slice-append-2"},
    		&Company{Name: "company-slice-append-3"},
    	)
    
    	AssertAssociationCount(t, users, "Company", 3, "After Append")
    
    	DB.Model(&users).Association("Manager").Append(
    		GetUser("manager-slice-belongs-to-1", Config{}),
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Oct 30 09:15:49 UTC 2023
    - 9.3K bytes
    - Viewed (0)
  2. 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")
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed May 08 04:07:58 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  3. tests/embedded_struct_test.go

    		t.Errorf("no error should happen when query with embedded struct, but got %v", err)
    	} else if egNews.BasePost.Title != "engadget_news" {
    		t.Errorf("embedded struct's value should be scanned correctly")
    	}
    
    	var egPosts []EngadgetPost
    	if err := DB.Order("author_name asc").Find(&egPosts).Error; err != nil {
    		t.Fatalf("no error should happen when query with embedded struct, but got %v", err)
    	}
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed May 08 04:07:58 UTC 2024
    - 7.3K bytes
    - Viewed (0)
  4. tests/connpool_test.go

    }
    
    func (c *wrapperTx) PrepareContext(ctx context.Context, query string) (*sql.Stmt, error) {
    	c.conn.got = append(c.conn.got, query)
    	return c.Tx.PrepareContext(ctx, query)
    }
    
    func (c *wrapperTx) ExecContext(ctx context.Context, query string, args ...interface{}) (sql.Result, error) {
    	c.conn.got = append(c.conn.got, query)
    	return c.Tx.ExecContext(ctx, query, args...)
    }
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Feb 06 02:54:40 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  5. tests/helper_test.go

    	}
    
    	for i := 0; i < config.Pets; i++ {
    		user.Pets = append(user.Pets, &Pet{Name: name + "_pet_" + strconv.Itoa(i+1)})
    	}
    
    	for i := 0; i < config.Toys; i++ {
    		user.Toys = append(user.Toys, Toy{Name: name + "_toy_" + strconv.Itoa(i+1)})
    	}
    
    	for i := 0; i < config.Tools; i++ {
    		user.Tools = append(user.Tools, Tools{Name: name + "_tool_" + strconv.Itoa(i+1)})
    	}
    
    	if config.Company {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Tue Mar 19 03:50:28 UTC 2024
    - 8K bytes
    - Viewed (0)
  6. tests/count_test.go

    		t.Fatalf("Count should be 3, but got count: %v err %v", count10, err)
    	}
    
    	var count11 int64
    	sameUsers := make([]*User, 0)
    	for i := 0; i < 3; i++ {
    		sameUsers = append(sameUsers, GetUser("count-4", Config{}))
    	}
    	DB.Create(sameUsers)
    
    	if err := DB.Model(&User{}).Where("name = ?", "count-4").Group("name").Count(&count11).Error; err != nil || count11 != 1 {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Mon Oct 30 09:15:49 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  7. tests/prepared_stmt_test.go

    	txCtx.Create(&user)
    
    	var result1 User
    	if err := txCtx.Find(&result1, user.ID).Error; err != nil {
    		t.Fatalf("no error should happen but got %v", err)
    	}
    
    	time.Sleep(time.Second)
    
    	var result2 User
    	if err := tx.Find(&result2, user.ID).Error; err != nil {
    		t.Fatalf("no error should happen but got %v", err)
    	}
    
    	user2 := *GetUser("prepared_stmt2", Config{})
    	if err := txCtx.Create(&user2).Error; err == nil {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Thu Mar 21 07:55:43 UTC 2024
    - 4K bytes
    - Viewed (0)
  8. tests/associations_has_one_test.go

    	}
    
    	// Append
    	DB.Model(&users).Association("Account").Append(
    		&Account{Number: "account-slice-append-1"},
    		&Account{Number: "account-slice-append-2"},
    		&Account{Number: "account-slice-append-3"},
    	)
    
    	AssertAssociationCount(t, users, "Account", 3, "After Append")
    
    	// Replace -> same as append
    
    	// Delete
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  9. schema/utils.go

    				switch result.Kind() {
    				case reflect.Struct:
    					reflectResults = reflect.Append(reflectResults, result.Addr())
    				case reflect.Slice, reflect.Array:
    					for i := 0; i < result.Len(); i++ {
    						if elem := result.Index(i); elem.Kind() == reflect.Ptr {
    							reflectResults = reflect.Append(reflectResults, elem)
    						} else {
    							reflectResults = reflect.Append(reflectResults, elem.Addr())
    						}
    					}
    				}
    			}
    		}
    
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Sat Aug 19 13:35:14 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  10. schema/schema_helper_test.go

    					for _, rf := range r.References {
    						var primaryKey, primaryKeySchema string
    						if rf.PrimaryKey != nil {
    							primaryKey, primaryKeySchema = rf.PrimaryKey.Name, rf.PrimaryKey.Schema.Name
    						}
    						refs = append(refs, fmt.Sprintf(
    							"{PrimaryKey: %v PrimaryKeySchame: %v ForeignKey: %v ForeignKeySchema: %v PrimaryValue: %v OwnPrimaryKey: %v}",
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Fri Dec 15 08:31:23 UTC 2023
    - 7.5K bytes
    - Viewed (0)
Back to top