Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for Explain (0.2 sec)

  1. tests/sql_builder_test.go

    func (ageFloat) String() string {
    	return "age"
    }
    
    func TestExplainSQL(t *testing.T) {
    	user := *GetUser("explain-sql", Config{})
    	dryRunDB := DB.Session(&gorm.Session{DryRun: true})
    
    	stmt := dryRunDB.Model(&user).Where("id = ?", 1).Updates(map[string]interface{}{"age": ageInt(8)}).Statement
    	sql := DB.Dialector.Explain(stmt.SQL.String(), stmt.Vars...)
    	if !regexp.MustCompile(`.*age.*=8,`).MatchString(sql) {
    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