Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for joins_with_select (0.15 sec)

  1. tests/joins_test.go

    	type result struct {
    		ID    uint
    		PetID uint
    		Name  string
    	}
    
    	user := *GetUser("joins_with_select", Config{Pets: 2})
    	DB.Save(&user)
    
    	var results []result
    
    	DB.Table("users").Select("users.id, pets.id as pet_id, pets.name").Joins("left join pets on pets.user_id = users.id").Where("users.name = ?", "joins_with_select").Scan(&results)
    
    	sort.Slice(results, func(i, j int) bool {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 15K bytes
    - Viewed (0)
Back to top