Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 2,073 for user (4.98 sec)

  1. tests/update_test.go

    	if users[1].Name != "update_column_02_newname" || users[1].Age != 100 {
    		t.Errorf("user 2 should be updated with update column")
    	}
    	AssertEqual(t, lastUpdatedAt.UnixNano(), users[1].UpdatedAt.UnixNano())
    
    	// user2 should not be updated
    	var user1, user2 User
    	DB.First(&user1, users[0].ID)
    	DB.First(&user2, users[1].ID)
    	CheckUser(t, user1, *users[0])
    	CheckUser(t, user2, *users[1])
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  2. tests/count_test.go

    func TestCount(t *testing.T) {
    	var (
    		user1                 = *GetUser("count-1", Config{})
    		user2                 = *GetUser("count-2", Config{})
    		user3                 = *GetUser("count-3", Config{})
    		users                 []User
    		count, count1, count2 int64
    	)
    
    	DB.Save(&user1).Save(&user2).Save(&user3)
    
    	if err := DB.Where("name = ?", user1.Name).Or("name = ?", user3.Name).Find(&users).Count(&count).Error; err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 6.9K bytes
    - Viewed (0)
  3. tests/associations_has_many_test.go

    		t.Fatalf("errors happened when create: %v", err)
    	}
    
    	CheckUser(t, user, user)
    
    	// Find
    	var user2 User
    	DB.Find(&user2, "id = ?", user.ID)
    	DB.Model(&user2).Association("Team").Find(&user2.Team)
    	CheckUser(t, user2, user)
    
    	// Count
    	AssertAssociationCount(t, user, "Team", 2, "")
    
    	// Append
    	team := *GetUser("team", Config{})
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 15.6K bytes
    - Viewed (0)
  4. tests/create_test.go

    	user.Birthday = nil
    	user.Pets = nil
    	user.Company = Company{}
    	user.Team = nil
    	user.Friends = nil
    
    	CheckUser(t, user2, user)
    }
    
    func TestOmitWithCreate(t *testing.T) {
    	user := *GetUser("omit_create", Config{Account: true, Pets: 3, Toys: 3, Company: true, Manager: true, Team: 3, Languages: 3, Friends: 4})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  5. tests/transaction_test.go

    	if err := tx.First(&User{}, "name = ?", user.Name).Error; err != nil {
    		t.Fatalf("Should find saved record")
    	}
    
    	if err := tx.SavePoint("save_point1").Error; err != nil {
    		t.Fatalf("Failed to save point, got error %v", err)
    	}
    
    	user1 := *GetUser("transaction-save-point-1", Config{})
    	tx.Create(&user1)
    
    	if err := tx.First(&User{}, "name = ?", user1.Name).Error; err != nil {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  6. tests/prepared_stmt_test.go

    	defer cancel()
    	txCtx := tx.WithContext(ctx)
    
    	user := *GetUser("prepared_stmt", Config{})
    
    	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)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 07:55:43 GMT 2024
    - 4K bytes
    - Viewed (0)
  7. tests/delete_test.go

    		}
    	}
    
    	for _, user := range []User{users[0], users[2]} {
    		result = User{}
    		if err := DB.Where("id = ?", user.ID).First(&result).Error; err != nil {
    			t.Errorf("no error should returns when query %v, but got %v", user.ID, err)
    		}
    	}
    
    	if err := DB.Delete(&users[0]).Error; err != nil {
    		t.Errorf("errors happened when delete: %v", err)
    	}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Oct 10 07:03:34 GMT 2023
    - 9.4K bytes
    - Viewed (0)
  8. chainable_api.go

    //
    //	// Find the first user with name jinzhu
    //	db.Where("name = ?", "jinzhu").First(&user)
    //	// Find the first user with name jinzhu and age 20
    //	db.Where(&User{Name: "jinzhu", Age: 20}).First(&user)
    //	// Find the first user with name jinzhu and age not equal to 20
    //	db.Where("name = ?", "jinzhu").Where("age <> ?", "20").First(&user)
    //
    // [docs]: https://gorm.io/docs/query.html#Conditions
    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)
  9. schema/relationship_test.go

    	type User struct {
    		ID        int32 `gorm:"primaryKey"`
    		Name      string
    		CreatorID *int32
    		Creator   *User
    	}
    
    	checkStructRelation(t, &User{}, Relation{
    		Name: "Creator", Type: schema.BelongsTo, Schema: "User", FieldSchema: "User",
    		References: []Reference{{"ID", "User", "CreatorID", "User", "", false}},
    	})
    }
    
    func TestSelfReferentialBelongsToOverrideReferences(t *testing.T) {
    	type User struct {
    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)
  10. api/maven-api-core/src/main/java/org/apache/maven/api/services/Prompter.java

    import org.apache.maven.api.annotations.Nullable;
    
    /**
     * Service used to interact with the end user.
     *
     * @since 4.0.0
     */
    @Experimental
    public interface Prompter extends Service {
        /**
         * Prompts the user for a string.
         *
         * @param message the message to display to the user
         * @return the string entered by the user
         * @throws PrompterException if an exception occurs
         */
        @Nonnull
    Java
    - Registered: Sun May 05 03:35:11 GMT 2024
    - Last Modified: Fri Nov 17 15:52:15 GMT 2023
    - 3.5K bytes
    - Viewed (0)
Back to top