Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 24 for Cordier (0.15 sec)

  1. clause/benchmarks_test.go

    		}
    
    		for _, clause := range clauses {
    			stmt.AddClause(clause)
    		}
    
    		stmt.Build("SELECT", "FROM", "WHERE", "GROUP BY", "LIMIT", "ORDER BY")
    		_ = stmt.SQL.String()
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Oct 07 12:14:14 GMT 2022
    - 1.9K bytes
    - Viewed (0)
  2. utils/tests/models.go

    }
    
    type CouponProduct struct {
    	CouponId  int    `gorm:"primarykey;size:255"`
    	ProductId string `gorm:"primarykey;size:255"`
    	Desc      string
    }
    
    type Order struct {
    	gorm.Model
    	Num      string
    	Coupon   *Coupon
    	CouponID string
    }
    
    type Parent struct {
    	gorm.Model
    	FavChildID uint
    	FavChild   *Child
    	Children   []*Child
    }
    
    type Child struct {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Dec 15 08:36:08 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  3. finisher_api.go

    			}
    		}
    
    		tx.Statement.AddClause(clause.Select{Expression: expr})
    	}
    
    	if orderByClause, ok := db.Statement.Clauses["ORDER BY"]; ok {
    		if _, ok := db.Statement.Clauses["GROUP BY"]; !ok {
    			delete(tx.Statement.Clauses, "ORDER BY")
    			defer func() {
    				tx.Statement.Clauses["ORDER BY"] = orderByClause
    			}()
    		}
    	}
    
    	tx.Statement.Dest = count
    	tx = tx.callbacks.Query().Execute(tx)
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 22.7K bytes
    - Viewed (0)
  4. tests/gorm_test.go

    			t.Fatalf("ID expects : not equal 0, got %v", u1.ID)
    		} else if u2.ID == 0 {
    			t.Fatalf("ID expects : not equal 0, got %v", u2.ID)
    		}
    
    		var gotUsers []user
    		results = DB.Where("id in (?, ?)", u1.ID, u2.ID).Order("id asc").Select("id, name").Find(&gotUsers)
    		if results.Error != nil {
    			t.Fatalf("errors happened on first: %v", results.Error)
    		} else if results.RowsAffected != 2 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jun 01 07:22:21 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  5. tests/preload_suits_test.go

    		if err := DB.Save(want).Error; err != nil {
    			t.Error(err)
    		}
    	}
    
    	var gots []*Level3
    	if err := DB.Preload("Level2.Level1s", func(db *gorm.DB) *gorm.DB {
    		return db.Order("level1.id ASC")
    	}).Find(&gots).Error; err != nil {
    		t.Error(err)
    	}
    
    	if !reflect.DeepEqual(gots, wants) {
    		t.Errorf("got %s; want %s", toJSONString(gots), toJSONString(wants))
    	}
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Mar 18 05:38:46 GMT 2022
    - 30.3K bytes
    - Viewed (0)
  6. tests/migrate_test.go

    			t.Fatalf("Should have index on %s", "CompanyI.")
    		}
    
    		if !m.HasIndex(&DynamicUser{}, "DeletedAt") {
    			t.Fatalf("Should have index on deleted_at.")
    		}
    	}
    }
    
    // check column order after migration, flaky test
    // https://github.com/go-gorm/gorm/issues/4351
    func TestMigrateColumnOrder(t *testing.T) {
    	type UserMigrateColumn struct {
    		ID uint
    	}
    	DB.Migrator().DropTable(&UserMigrateColumn{})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Mar 18 11:24:16 GMT 2024
    - 56.2K bytes
    - Viewed (0)
  7. clause/order_by_test.go

    			}},
    			"SELECT * FROM `users` ORDER BY `users`.`id` DESC", nil,
    		},
    		{
    			[]clause.Interface{
    				clause.Select{}, clause.From{}, clause.OrderBy{
    					Columns: []clause.OrderByColumn{{Column: clause.PrimaryColumn, Desc: true}},
    				}, clause.OrderBy{
    					Columns: []clause.OrderByColumn{{Column: clause.Column{Name: "name"}}},
    				},
    			},
    			"SELECT * FROM `users` ORDER BY `users`.`id` DESC,`name`", nil,
    		},
    		{
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 1.6K bytes
    - Viewed (0)
  8. callbacks/callbacks.go

    package callbacks
    
    import (
    	"gorm.io/gorm"
    )
    
    var (
    	createClauses = []string{"INSERT", "VALUES", "ON CONFLICT"}
    	queryClauses  = []string{"SELECT", "FROM", "WHERE", "GROUP BY", "ORDER BY", "LIMIT", "FOR"}
    	updateClauses = []string{"UPDATE", "SET", "WHERE"}
    	deleteClauses = []string{"DELETE", "FROM", "WHERE"}
    )
    
    type Config struct {
    	LastInsertIDReversed bool
    	CreateClauses        []string
    	QueryClauses         []string
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Oct 27 23:56:55 GMT 2021
    - 3.3K bytes
    - Viewed (0)
  9. tests/query_test.go

    		t.Fatalf("Build Order condition, but got %v", result.Statement.SQL.String())
    	}
    
    	result = dryDB.Order("age desc, name").Find(&User{})
    	if !regexp.MustCompile("SELECT \\* FROM .*users.* ORDER BY age desc, name").MatchString(result.Statement.SQL.String()) {
    		t.Fatalf("Build Order condition, but got %v", result.Statement.SQL.String())
    	}
    
    	result = dryDB.Order("age desc").Order("name").Find(&User{})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Apr 25 12:22:53 GMT 2024
    - 49.8K bytes
    - Viewed (0)
  10. tests/sql_builder_test.go

    	// find
    	sql := DB.ToSQL(func(tx *gorm.DB) *gorm.DB {
    		return tx.Model(&User{}).Where("id = ?", 100).Limit(10).Order("age desc").Find(&[]User{})
    	})
    	assertEqualSQL(t, `SELECT * FROM "users" WHERE id = 100 AND "users"."deleted_at" IS NULL ORDER BY age desc LIMIT 10`, sql)
    
    	// after model changed
    	if DB.Statement.DryRun || DB.DryRun {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Jan 12 08:42:21 GMT 2024
    - 16.7K bytes
    - Viewed (0)
Back to top