Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 22 for Company (0.25 sec)

  1. tests/joins_test.go

    		return
    	}
    }
    
    func TestJoinCount(t *testing.T) {
    	companyA := Company{Name: "A"}
    	companyB := Company{Name: "B"}
    	DB.Create(&companyA)
    	DB.Create(&companyB)
    
    	user := User{Name: "kingGo", CompanyID: &companyB.ID}
    	DB.Create(&user)
    
    	query := DB.Model(&User{}).Joins("Company")
    	// Bug happens when .Count is called on a query.
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Wed Apr 26 14:19:32 GMT 2023
    - 13.5K bytes
    - Viewed (1)
  2. tests/update_test.go

    	if result.Name != "new company name" {
    		t.Errorf("name should be %v, but got %v", user.Company.Name, result.Name)
    	}
    }
    
    func TestIdempotentSave(t *testing.T) {
    	create := Company{
    		Name: "company_idempotent",
    	}
    	DB.Create(&create)
    
    	var company Company
    	if err := DB.Find(&company, "id = ?", create.ID).Error; err != nil {
    		t.Fatalf("failed to find created company, got err: %v", err)
    	}
    
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
  3. schema/schema_test.go

    		{Name: "ID", DBName: "company_id", BindNames: []string{"Base", "ID"}, DataType: schema.Int, Size: 64, TagSettings: map[string]string{"EMBEDDED": "EMBEDDED", "EMBEDDEDPREFIX": "company_"}},
    		{Name: "Name", DBName: "company_name", BindNames: []string{"Base", "Name"}, DataType: schema.String, TagSettings: map[string]string{"EMBEDDED": "EMBEDDED", "EMBEDDEDPREFIX": "company_"}},
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Dec 15 08:31:23 GMT 2023
    - 12.9K bytes
    - Viewed (0)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. tests/sql_builder_test.go

    	if !strings.Contains(str, "rgs.id = user.id") {
    		t.Errorf("The second join condition is over written instead of combining")
    	}
    
    	if !strings.Contains(str, "`users`.`company_id` = `companies`.`id`") && !strings.Contains(str, "\"users\".\"company_id\" = \"companies\".\"id\"") {
    		t.Errorf("The first join condition is over written instead of combining")
    	}
    }
    
    func TestToSQL(t *testing.T) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  9. docs/bucket/replication/README.md

    mc replicate add myminio/srcbucket/Tax --priority 1 --remote-bucket destbucket --remote-bucket "arn:minio:replication:us-east-1:c5be6b16-769d-432a-9ef1-4567081f3566:destbucket" --tags "Year=2019&Company=AcmeCorp" --storage-class "STANDARD" --replicate "delete,delete-marker"
    Replication configuration applied successfully to myminio/srcbucket.
    ```
    
    Plain Text
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Jan 24 23:46:33 GMT 2023
    - 18.2K bytes
    - Viewed (0)
  10. tests/table_test.go

    	dryDB := DB.Session(&gorm.Session{DryRun: true, QueryFields: true})
    	userQuery := "SELECT .*user.*id.*user.*created_at.*user.*updated_at.*user.*deleted_at.*user.*name.*user.*age" +
    		".*user.*birthday.*user.*company_id.*user.*manager_id.*user.*active.* "
    
    	r := dryDB.Table("`user`").Find(&User{}).Statement
    	if !regexp.MustCompile(userQuery + "FROM `user`").MatchString(r.Statement.SQL.String()) {
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
Back to top