Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,077 for company (0.19 sec)

  1. tests/count_test.go

    )
    
    func TestCountWithGroup(t *testing.T) {
    	DB.Create([]Company{
    		{Name: "company_count_group_a"},
    		{Name: "company_count_group_a"},
    		{Name: "company_count_group_a"},
    		{Name: "company_count_group_b"},
    		{Name: "company_count_group_c"},
    	})
    
    	var count1 int64
    	if err := DB.Model(&Company{}).Where("name = ?", "company_count_group_a").Group("name").Count(&count1).Error; err != nil {
    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/create_test.go

    	}
    }
    
    func TestFirstOrCreateWithPrimaryKey(t *testing.T) {
    	company := Company{ID: 100, Name: "company100_with_primarykey"}
    	DB.FirstOrCreate(&company)
    
    	if company.ID != 100 {
    		t.Errorf("invalid primary key after creating, got %v", company.ID)
    	}
    
    	companies := []Company{
    		{ID: 101, Name: "company101_with_primarykey"},
    		{ID: 102, Name: "company102_with_primarykey"},
    	}
    	DB.Create(&companies)
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  3. utils/utils.go

    	}
    	return ""
    }
    
    const nestedRelationSplit = "__"
    
    // NestedRelationName nested relationships like `Manager__Company`
    func NestedRelationName(prefix, name string) string {
    	return prefix + nestedRelationSplit + name
    }
    
    // SplitNestedRelationName Split nested relationships to `[]string{"Manager","Company"}`
    func SplitNestedRelationName(name string) []string {
    	return strings.Split(name, nestedRelationSplit)
    }
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  4. internal/s3select/sql/jsondata/books.json

                "publisher": "Collins Crime Club (London)",
                "type": "Hardcover",
                "pages": 256
            },
            {
                "year": 1934,
                "publisher": "Dodd Mead and Company (New York)",
                "type": "Hardcover",
                "pages": 302
            },
            {
                "year": 2011,
                "publisher": "Harper Collins",
                "type": "Paperback",
    Json
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jun 01 21:59:40 GMT 2021
    - 1.9K bytes
    - Viewed (0)
  5. schema/model_test.go

    type User struct {
    	*gorm.Model
    	Name      *string
    	Age       *uint
    	Birthday  *time.Time
    	Account   *tests.Account
    	Pets      []*tests.Pet
    	Toys      []*tests.Toy `gorm:"polymorphic:Owner"`
    	CompanyID *int
    	Company   *tests.Company
    	ManagerID *uint
    	Manager   *User
    	Team      []*User           `gorm:"foreignkey:ManagerID"`
    	Languages []*tests.Language `gorm:"many2many:UserSpeak"`
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.1K bytes
    - Viewed (0)
  6. tests/associations_many2many_test.go

    		{Name: "TestMany2ManyDuplicateBelongsToAssociation-friend-1", Company: Company{
    			ID:   1,
    			Name: "Test-company-1",
    		}},
    	}}
    
    	user2 := User{Name: "TestMany2ManyDuplicateBelongsToAssociation-2", Friends: []*User{
    		{Name: "TestMany2ManyDuplicateBelongsToAssociation-friend-2", Company: Company{
    			ID:   1,
    			Name: "Test-company-1",
    		}},
    	}}
    	users := []*User{&user1, &user2}
    	var err error
    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)
  7. tests/associations_test.go

    	user := *GetUser("TestAssociationError", Config{Pets: 2, Company: true, Account: true, Languages: 2})
    	DB.Create(&user)
    
    	var user1 User
    	DB.Preload("Company").Preload("Pets").Preload("Account").Preload("Languages").First(&user1)
    
    	var emptyUser User
    	var err error
    	// belongs to
    	err = DB.Model(&emptyUser).Association("Company").Delete(&user1.Company)
    	AssertEqual(t, err, gorm.ErrPrimaryKeyRequired)
    	// has many
    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)
  8. clause/from_test.go

    							},
    						}, {
    							Type:  clause.LeftJoin,
    							Table: clause.Table{Name: "companies"},
    							Using: []string{"company_name"},
    						},
    					},
    				},
    			},
    			"SELECT * FROM `users` INNER JOIN `articles` ON `articles`.`id` = `users`.`id` LEFT JOIN `companies` USING (`company_name`)", nil,
    		},
    	}
    
    	for idx, result := range results {
    		t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Jul 15 02:25:10 GMT 2020
    - 1.9K bytes
    - Viewed (0)
  9. callbacks/query.go

    								ON:    clause.Where{Exprs: exprs},
    							}
    						}
    
    						parentTableName := clause.CurrentTable
    						for _, rel := range relations {
    							// joins table alias like "Manager, Company, Manager__Company"
    							nestedAlias := utils.NestedRelationName(parentTableName, rel.Name)
    							if _, ok := specifiedRelationsName[nestedAlias]; !ok {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  10. docs/extensions/s3zip/README.md

    e.g.:
    To download `2021/taxes.csv` archived in `financial.zip` and stored under a bucket named `company-data`, you can issue a GET request using the following path 'company-data/financial.zip/2021/taxes.csv`
    
    ## Contents properties
    
    Plain Text
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Apr 10 16:28:27 GMT 2024
    - 3K bytes
    - Viewed (0)
Back to top