Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 170 for count (0.21 sec)

  1. tests/count_test.go

    		t.Errorf("count with join, got error: %v, count %v", err, count4)
    	}
    
    	var count5 int64
    	if err := DB.Table("users").Where("users.name = ?", user1.Name).Order("name").Count(&count5).Error; err != nil || count5 != 1 {
    		t.Errorf("count with join, got error: %v, count %v", err, count)
    	}
    
    	var count6 int64
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 6.9K bytes
    - Viewed (0)
  2. tests/soft_delete_test.go

    		t.Errorf("Should find soft deleted record with Unscoped, but got err %s", err)
    	}
    
    	count = 0
    	if DB.Unscoped().Model(&User{}).Where("name = ?", user.Name).Count(&count).Error != nil || count != 1 {
    		t.Errorf("Count soft deleted record, expects: %v, count: %v", 1, count)
    	}
    
    	age = 0
    	if DB.Unscoped().Model(&User{}).Select("age").Where("name = ?", user.Name).Scan(&age).Error != nil || age != user.Age {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 5.7K bytes
    - Viewed (0)
  3. cmd/os_other.go

    	maxEntries := 1000
    	if opts.count > 0 && opts.count < maxEntries {
    		maxEntries = opts.count
    	}
    
    	done := false
    	remaining := opts.count
    
    	for !done {
    		// Read up to max number of entries.
    		fis, err := d.Readdir(maxEntries)
    		if err != nil {
    			if err == io.EOF {
    				break
    			}
    			return nil, osErrToFileErr(err)
    		}
    		if opts.count > -1 {
    			if remaining <= len(fis) {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Sep 13 15:14:36 GMT 2023
    - 4K bytes
    - Viewed (0)
  4. cmd/metrics-v3-cluster-health.go

    import "context"
    
    const (
    	healthDrivesOfflineCount = "drives_offline_count"
    	healthDrivesOnlineCount  = "drives_online_count"
    	healthDrivesCount        = "drives_count"
    )
    
    var (
    	healthDrivesOfflineCountMD = NewGaugeMD(healthDrivesOfflineCount,
    		"Count of offline drives in the cluster")
    	healthDrivesOnlineCountMD = NewGaugeMD(healthDrivesOnlineCount,
    		"Count of online drives in the cluster")
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Mar 10 09:15:15 GMT 2024
    - 3.9K bytes
    - Viewed (0)
  5. tests/associations_test.go

    	. "gorm.io/gorm/utils/tests"
    )
    
    func AssertAssociationCount(t *testing.T, data interface{}, name string, result int64, reason string) {
    	if count := DB.Model(data).Association(name).Count(); count != result {
    		t.Fatalf("invalid %v count %v, expects: %v got %v", name, reason, result, count)
    	}
    
    	var newUser User
    	if user, ok := data.(User); ok {
    		DB.Find(&newUser, "id = ?", user.ID)
    	} else if user, ok := data.(*User); ok {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Feb 08 08:29:09 GMT 2023
    - 10.9K bytes
    - Viewed (0)
  6. tests/associations_has_many_test.go

    	CheckPet(t, pets[0], *user.Pets[0])
    
    	if count := DB.Model(&user).Where("name = ?", user.Pets[1].Name).Association("Pets").Count(); count != 1 {
    		t.Fatalf("should only find one pets, but got %v", count)
    	}
    
    	if count := DB.Model(&user).Where("name = ?", "not found").Association("Pets").Count(); count != 0 {
    		t.Fatalf("should only find no pet with invalid conditions, but got %v", count)
    	}
    
    	// Count
    	AssertAssociationCount(t, user, "Pets", 2, "")
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 15.6K bytes
    - Viewed (0)
  7. cmd/site-replication-metrics.go

    	hourTotals := rt.LastHour.getTotal()
    	return madmin.TimedErrStats{
    		LastMinute: madmin.RStat{
    			Count: float64(minuteTotals.N),
    			Bytes: minuteTotals.Size,
    		},
    		LastHour: madmin.RStat{
    			Count: float64(hourTotals.N),
    			Bytes: hourTotals.Size,
    		},
    		Totals: madmin.RStat{
    			Count: float64(rt.SinceUptime.Count),
    			Bytes: rt.SinceUptime.Bytes,
    		},
    		ErrCounts: errCounts,
    	}
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Feb 06 06:00:45 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  8. cmd/metrics-v3-cluster-usage.go

    	usageTotalBytes               = "total_bytes"
    	usageObjectsCount             = "count"
    	usageVersionsCount            = "versions_count"
    	usageDeleteMarkersCount       = "delete_markers_count"
    	usageBucketsCount             = "buckets_count"
    	usageSizeDistribution         = "size_distribution"
    	usageVersionCountDistribution = "version_count_distribution"
    )
    
    var (
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  9. tests/associations_many2many_test.go

    	}
    
    	count := 3
    
    	var languages []Language
    	for i := 0; i < count; i++ {
    		language := Language{Code: fmt.Sprintf("consurrent %d", i)}
    		db.Create(&language)
    		languages = append(languages, language)
    	}
    
    	user := User{}
    	db.Create(&user)
    	db.Preload("Languages").FirstOrCreate(&user)
    
    	var wg sync.WaitGroup
    	for i := 0; i < count; i++ {
    		wg.Add(1)
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Jun 10 13:05:19 GMT 2023
    - 13.2K bytes
    - Viewed (0)
  10. internal/s3select/select_benchmark_test.go

    }
    
    func benchmarkAggregateCount(b *testing.B, count int) {
    	benchmarkSelect(b, count, "select count(*) from S3Object")
    }
    
    // BenchmarkAggregateCount_100K - benchmark count(*) function with 100k records.
    func BenchmarkAggregateCount_100K(b *testing.B) {
    	benchmarkAggregateCount(b, 100*humanize.KiByte)
    }
    
    // BenchmarkAggregateCount_1M - benchmark count(*) function with 1m records.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 14 13:54:47 GMT 2022
    - 5K bytes
    - Viewed (0)
Back to top