Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 7,081 for Find (0.25 sec)

  1. tests/upsert_test.go

    	}
    
    	DB.Where(&User{Name: "find or init"}).Assign("age", 44).FirstOrInit(&user4)
    	if user4.Name != "find or init" || user4.ID != 0 || user4.Age != 44 {
    		t.Errorf("user should be initialized with search value and assign attrs")
    	}
    
    	DB.Save(&User{Name: "find or init", Age: 33})
    	DB.Where(&User{Name: "find or init"}).Attrs("age", 44).FirstOrInit(&user5)
    	if user5.Name != "find or init" || user5.ID == 0 || user5.Age != 33 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  2. tests/transaction_test.go

    	if err := DB.First(&User{}, "name = ?", user.Name).Error; err != nil {
    		t.Fatalf("Should find saved record")
    	}
    
    	if err := DB.First(&User{}, "name = ?", user1.Name).Error; err == nil {
    		t.Fatalf("Should not find rollbacked record")
    	}
    
    	if err := DB.First(&User{}, "name = ?", user2.Name).Error; err != nil {
    		t.Fatalf("Should find saved record")
    	}
    }
    
    func TestNestedTransactionWithBlock(t *testing.T) {
    	var (
    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)
  3. guava-testlib/src/com/google/common/collect/testing/testers/AbstractListIndexOfTester.java

      protected abstract int find(@Nullable Object o);
    
      /** Override to return "indexOf" or "lastIndexOf()" for use in failure messages. */
      protected abstract String getMethodName();
    
      @CollectionSize.Require(absent = ZERO)
      public void testFind_yes() {
        assertEquals(
            getMethodName() + "(firstElement) should return 0", 0, find(getOrderedElements().get(0)));
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Apr 20 11:19:03 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/internal/connection/FastFallbackExchangeFinderTest.kt

        val plan1 = routePlanner.addPlan()
        plan1.connectState = TLS_CONNECTED
    
        taskRunner.newQueue().execute("connect") {
          val result0 = finder.find()
          assertThat(result0).isEqualTo(plan0.connection)
          val result1 = finder.find()
          assertThat(result1).isEqualTo(plan1.connection)
        }
    
        taskFaker.runTasks()
        assertEvents(
          "take plan 0",
          "take plan 1",
        )
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 24 04:40:49 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  5. tests/query_test.go

    	if (len(users1) != len(users4)) || (len(users1)-len(users2) != 3) || (len(users1)-len(users3) != 5) {
    		t.Errorf("Offset should work")
    	}
    
    	DB.Where("name like ?", "OffsetUser%").Order("age desc").Find(&users1).Offset(3).Find(&users2).Offset(5).Find(&users3).Offset(-1).Find(&users4)
    
    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. chainable_api.go

    // [docs] for more depth.
    //
    //	// add a simple limit clause
    //	db.Clauses(clause.Limit{Limit: 1}).Find(&User{})
    //	// tell the optimizer to use the `idx_user_name` index
    //	db.Clauses(hints.UseIndex("idx_user_name")).Find(&User{})
    //	// specify the lock strength to UPDATE
    //	db.Clauses(clause.Locking{Strength: "UPDATE"}).Find(&users)
    //
    // [docs]: https://gorm.io/docs/sql_builder.html#Clauses
    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)
  7. tests/associations_has_many_test.go

    	}
    
    	CheckUser(t, user, user)
    
    	// Find
    	var user2 User
    	DB.Find(&user2, "id = ?", user.ID)
    	DB.Model(&user2).Association("Pets").Find(&user2.Pets)
    	CheckUser(t, user2, user)
    
    	var pets []Pet
    	DB.Model(&user).Where("name = ?", user.Pets[0].Name).Association("Pets").Find(&pets)
    
    	if len(pets) != 1 {
    		t.Fatalf("should only find one pets, but got %v", len(pets))
    	}
    
    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)
  8. tests/table_test.go

    func TestTable(t *testing.T) {
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    
    	r := dryDB.Table("`user`").Find(&User{}).Statement
    	if !regexp.MustCompile("SELECT \\* FROM `user`").MatchString(r.Statement.SQL.String()) {
    		t.Errorf("Table with escape character, got %v", r.Statement.SQL.String())
    	}
    
    	r = dryDB.Table("user as u").Select("name").Find(&User{}).Statement
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  9. android/guava-testlib/src/com/google/common/collect/testing/testers/AbstractListIndexOfTester.java

      protected abstract int find(@Nullable Object o);
    
      /** Override to return "indexOf" or "lastIndexOf()" for use in failure messages. */
      protected abstract String getMethodName();
    
      @CollectionSize.Require(absent = ZERO)
      public void testFind_yes() {
        assertEquals(
            getMethodName() + "(firstElement) should return 0", 0, find(getOrderedElements().get(0)));
      }
    
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Thu Apr 20 11:19:03 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  10. tests/multi_primary_keys_test.go

    	var tags []Tag
    	DB.Model(&blog).Association("SharedTags").Find(&tags)
    	if !compareTags(tags, []string{"tag1", "tag2", "tag3"}) {
    		t.Fatalf("Should find 3 tags")
    	}
    
    	DB.Model(&blog2).Association("SharedTags").Find(&tags)
    	if !compareTags(tags, []string{"tag1", "tag2", "tag3"}) {
    		t.Fatalf("Should find 3 tags")
    	}
    
    	var blog1 Blog
    	DB.Preload("SharedTags").Find(&blog1)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 12.8K bytes
    - Viewed (0)
Back to top