Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for language_code (0.12 sec)

  1. tests/distinct_test.go

    	}
    
    	dryDB := DB.Session(&gorm.Session{DryRun: true})
    	r := dryDB.Distinct("u.id, u.*").Table("user_speaks as s").Joins("inner join users as u on u.id = s.user_id").Where("s.language_code ='US' or s.language_code ='ES'").Find(&User{})
    	if !regexp.MustCompile(`SELECT DISTINCT u\.id, u\.\* FROM user_speaks as s inner join users as u`).MatchString(r.Statement.SQL.String()) {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jan 06 07:02:53 UTC 2022
    - 2.5K bytes
    - Viewed (0)
  2. schema/schema_test.go

    				},
    				{
    					Name: "LanguageCode", DBName: "language_code", BindNames: []string{"LanguageCode"}, DataType: schema.String,
    					Tag: `gorm:"primarykey"`, Creatable: true, Updatable: true, Readable: true, PrimaryKey: true,
    				},
    			}},
    			References: []Reference{{"ID", "User", "UserID", "UserSpeak", "", true}, {"Code", "Language", "LanguageCode", "UserSpeak", "", false}},
    		},
    		{
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Thu Jun 20 12:19:31 UTC 2024
    - 13.3K bytes
    - Viewed (0)
  3. tests/joins_test.go

    	type UserSpeak struct {
    		UserID       uint
    		LanguageCode string
    	}
    	type Result struct {
    		User
    		UserSpeak
    		Language
    		Pet
    	}
    
    	results := make([]Result, 0, 1)
    	DB.Select("users.*, user_speaks.*,  languages.*, pets.*").Table("users").Joins("JOIN user_speaks ON user_speaks.user_id = users.id").
    		Joins("JOIN languages ON languages.code = user_speaks.language_code").
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 17 03:58:13 UTC 2024
    - 15K bytes
    - Viewed (0)
  4. tests/associations_has_many_test.go

    		Contents: []ItemContent{
    			{Name: "name", LanguageCode: "en"},
    			{Name: "ar name", LanguageCode: "ar"},
    		},
    	}
    	if err := tx.Create(&item).Error; err != nil {
    		t.Fatalf("failed to create items, got error: %v", err)
    	}
    
    	// test Replace
    	if err := tx.Model(&item).Association("Contents").Unscoped().Replace([]ItemContent{
    		{Name: "updated name", LanguageCode: "en"},
    		{Name: "ar updated name", LanguageCode: "ar"},
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Wed Jun 12 10:49:45 UTC 2024
    - 16K bytes
    - Viewed (0)
  5. tests/preload_suits_test.go

    		t.Error(err)
    	}
    
    	want := Level2{Value: "Bob", LanguageCode: "ru", Level1s: []Level1{
    		{Value: "ru", LanguageCode: "ru"},
    		{Value: "en", LanguageCode: "en"},
    	}}
    	if err := DB.Save(&want).Error; err != nil {
    		t.Error(err)
    	}
    
    	want2 := Level2{Value: "Tom", LanguageCode: "zh", Level1s: []Level1{
    		{Value: "zh", LanguageCode: "zh"},
    		{Value: "de", LanguageCode: "de"},
    	}}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Mar 18 05:38:46 UTC 2022
    - 30.3K bytes
    - Viewed (0)
  6. tests/create_test.go

    	}
    }
    
    func TestCreateWithAutoIncrementCompositeKey(t *testing.T) {
    	type CompositeKeyProduct struct {
    		ProductID    int `gorm:"primaryKey;autoIncrement:true;"` // primary key
    		LanguageCode int `gorm:"primaryKey;"`                    // primary key
    		Code         string
    		Name         string
    	}
    
    	if err := DB.Migrator().DropTable(&CompositeKeyProduct{}); err != nil {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Tue Mar 19 03:50:28 UTC 2024
    - 26.4K bytes
    - Viewed (0)
Back to top