Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestComplexScopes (0.2 sec)

  1. tests/scopes_test.go

    		return db.WithContext(context.Background()).Table("users")
    	}
    	if err := DB.Scopes(userTable).Select("max(id)").Scan(&maxId).Error; err != nil {
    		t.Errorf("select max(id)")
    	}
    }
    
    func TestComplexScopes(t *testing.T) {
    	tests := []struct {
    		name     string
    		queryFn  func(tx *gorm.DB) *gorm.DB
    		expected string
    	}{
    		{
    			name: "depth_1",
    			queryFn: func(tx *gorm.DB) *gorm.DB {
    				return tx.Scopes(
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 3.3K bytes
    - Viewed (0)
Back to top