Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for silent (0.3 sec)

  1. tests/joins_test.go

    	if !regexp.MustCompile("SELECT .* FROM .users. left join pets.*join accounts.*").MatchString(stmt.SQL.String()) {
    		t.Errorf("joins should be ordered, but got %v", stmt.SQL.String())
    	}
    
    	iv := DB.Table(`table_invoices`).Select(`seller, SUM(total) as total, SUM(paid) as paid, SUM(balance) as balance`).Group(`seller`)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 26 14:19:32 GMT 2023
    - 13.5K bytes
    - Viewed (1)
  2. tests/create_test.go

    	}
    }
    
    func TestSelectWithCreate(t *testing.T) {
    	user := *GetUser("select_create", Config{Account: true, Pets: 3, Toys: 3, Company: true, Manager: true, Team: 3, Languages: 3, Friends: 4})
    	DB.Select("Account", "Toys", "Manager", "ManagerID", "Languages", "Name", "CreatedAt", "Age", "Active").Create(&user)
    
    	var user2 User
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 19 03:50:28 GMT 2024
    - 26.4K bytes
    - Viewed (0)
  3. chainable_api.go

    //
    // Use Select when you only want a subset of the fields. By default, GORM will select all fields.
    // Select accepts both string arguments and arrays.
    //
    //	// Select name and age of user using multiple arguments
    //	db.Select("name", "age").Find(&users)
    //	// Select name and age of user using an array
    //	db.Select([]string{"name", "age"}).Find(&users)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Apr 17 03:38:55 GMT 2024
    - 14.3K bytes
    - Viewed (1)
  4. migrator/migrator.go

    // Query in gorm.ViewOption is a [subquery]
    //
    //	// CREATE VIEW `user_view` AS SELECT * FROM `users` WHERE age > 20
    //	q := DB.Model(&User{}).Where("age > ?", 20)
    //	DB.Debug().Migrator().CreateView("user_view", gorm.ViewOption{Query: q})
    //
    //	// CREATE OR REPLACE VIEW `users_view` AS SELECT * FROM `users` WITH CHECK OPTION
    //	q := DB.Model(&User{})
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Fri Apr 26 07:15:49 GMT 2024
    - 29K bytes
    - Viewed (0)
  5. tests/hooks_test.go

    	DB.Model(&product).Select("Name", "Price").Updates(map[string]interface{}{"Name": "Product New2", "code": "L1213"})
    
    	if product.Name != "Product New2" || product.Price != 170 || product.Code != "L1212" {
    		t.Errorf("invalid data after update, got %+v", product)
    	}
    
    	// Code changed, price should changed
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 18 01:20:29 GMT 2023
    - 15.9K bytes
    - Viewed (0)
  6. callbacks/query.go

    	if db.Statement.Schema != nil {
    		for _, c := range db.Statement.Schema.QueryClauses {
    			db.Statement.AddClause(c)
    		}
    	}
    
    	if db.Statement.SQL.Len() == 0 {
    		db.Statement.SQL.Grow(100)
    		clauseSelect := clause.Select{Distinct: db.Statement.Distinct}
    
    		if db.Statement.ReflectValue.Kind() == reflect.Struct && db.Statement.ReflectValue.Type() == db.Statement.Schema.ModelType {
    			var conds []clause.Expression
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Jan 29 03:34:57 GMT 2024
    - 9.9K bytes
    - Viewed (0)
  7. callbacks/associations.go

    		tx.Statement.Settings.Store(k, v)
    		return true
    	})
    
    	if tx.Statement.FullSaveAssociations {
    		tx = tx.Set("gorm:update_track_time", true)
    	}
    
    	if len(selects) > 0 {
    		tx = tx.Select(selects)
    	} else if restricted && len(omits) == 0 {
    		tx = tx.Omit(clause.Associations)
    	}
    
    	if len(omits) > 0 {
    		tx = tx.Omit(omits...)
    	}
    
    	return db.AddError(tx.Create(values).Error)
    }
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Apr 11 03:06:13 GMT 2023
    - 14.3K bytes
    - Viewed (0)
  8. tests/table_test.go

    	}
    
    	r = dryDB.Table("gorm.user").Select("name").Find(&User{}).Statement
    	if !regexp.MustCompile("SELECT .name. FROM .gorm.\\..user. WHERE .user.\\..deleted_at. IS NULL").MatchString(r.Statement.SQL.String()) {
    		t.Errorf("Table with escape character, got %v", r.Statement.SQL.String())
    	}
    
    	r = dryDB.Select("name").Find(&UserWithTable{}).Statement
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Mar 09 09:31:28 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  9. finisher_api.go

    			tx.Statement.Model = nil
    		}()
    	}
    
    	if selectClause, ok := db.Statement.Clauses["SELECT"]; ok {
    		defer func() {
    			tx.Statement.Clauses["SELECT"] = selectClause
    		}()
    	} else {
    		defer delete(tx.Statement.Clauses, "SELECT")
    	}
    
    	if len(tx.Statement.Selects) == 0 {
    		tx.Statement.AddClause(clause.Select{Expression: clause.Expr{SQL: "count(*)"}})
    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)
  10. tests/update_test.go

    	})
    
    	AssertObjEqual(t, result2, result, "Name", "Account", "Toys", "Manager", "ManagerID", "Languages")
    
    	DB.Model(&result).Select("Name", "Age").Updates(User{Name: "update_with_select"})
    	if result.Age != 0 || result.Name != "update_with_select" {
    		t.Fatalf("Failed to update struct with select, got %+v", result)
    	}
    	AssertObjEqual(t, result, user, "UpdatedAt")
    
    	var result3 User
    	DB.First(&result3, result.ID)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Dec 04 03:50:58 GMT 2023
    - 30.3K bytes
    - Viewed (0)
Back to top