Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 7,425 for find (0.15 sec)

  1. tests/preload_test.go

    	}
    	AssertEqual(t, find2, value)
    
    	var finds []Value
    	err = DB.Joins("Nested.Join").Joins("Nested").Preload("Nested.Preloads").Find(&finds).Error
    	if err != nil {
    		t.Errorf("failed to find value, got err: %v", err)
    	}
    	require.Len(t, finds, 1)
    	AssertEqual(t, finds[0], value)
    }
    
    func TestEmbedPreload(t *testing.T) {
    	type Country struct {
    		ID   int `gorm:"primaryKey"`
    Go
    - Registered: Sun Apr 14 09:35:11 GMT 2024
    - Last Modified: Sat Mar 09 13:27:19 GMT 2024
    - 13.4K bytes
    - Viewed (0)
  2. 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 Apr 14 09:35:11 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 12.8K bytes
    - Viewed (0)
  3. 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 Apr 14 09:35:11 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  4. 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 Apr 14 09:35:11 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  5. tests/named_polymorphic_test.go

    	// Query
    	hamsterToy := Toy{}
    	DB.Model(&hamster).Association("PreferredToy").Find(&hamsterToy)
    	if hamsterToy.Name != hamster.PreferredToy.Name {
    		t.Errorf("Should find has one polymorphic association")
    	}
    
    	hamsterToy = Toy{}
    	DB.Model(&hamster).Association("OtherToy").Find(&hamsterToy)
    	if hamsterToy.Name != hamster.OtherToy.Name {
    		t.Errorf("Should find has one polymorphic association")
    	}
    
    	// Append
    Go
    - Registered: Sun Apr 14 09:35:11 GMT 2024
    - Last Modified: Wed Jul 08 09:59:40 GMT 2020
    - 4.2K bytes
    - Viewed (0)
  6. tests/joins_table_test.go

    		t.Fatalf("Should have one address left")
    	}
    
    	if DB.Find(&[]PersonAddress{}, "person_id = ?", person.ID).RowsAffected != 1 {
    		t.Fatalf("Should found one address")
    	}
    
    	var addresses2 []Address
    	if err := DB.Model(&person).Association("Addresses").Find(&addresses2); err != nil || len(addresses2) != 1 {
    		t.Fatalf("Failed to find address, got error %v, length: %v", err, len(addresses2))
    	}
    
    Go
    - Registered: Sun Apr 14 09:35:11 GMT 2024
    - Last Modified: Thu Sep 10 13:46:18 GMT 2020
    - 3.5K bytes
    - Viewed (0)
  7. 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 Apr 19 11:42:09 GMT 2024
    - Last Modified: Thu Apr 11 01:59:58 GMT 2024
    - 20.7K 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 Apr 14 09:35:11 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 Apr 19 12:43:09 GMT 2024
    - Last Modified: Thu Apr 20 11:19:03 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  10. internal/s3select/unused-errors.go

    	return &s3Error{
    		code:       "ParseExpectedDatePart",
    		message:    "Did not find the expected date part in the SQL expression.",
    		statusCode: 400,
    		cause:      err,
    	}
    }
    
    func errParseExpectedKeyword(err error) *s3Error {
    	return &s3Error{
    		code:       "ParseExpectedKeyword",
    		message:    "Did not find the expected keyword in the SQL expression.",
    		statusCode: 400,
    		cause:      err,
    	}
    }
    Go
    - Registered: Sun Apr 07 19:28:10 GMT 2024
    - Last Modified: Tue Feb 20 08:16:35 GMT 2024
    - 17.5K bytes
    - Viewed (0)
Back to top