Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 84 for Lange (0.23 sec)

  1. utils/utils.go

    }
    
    // CheckTruth check string true or not
    func CheckTruth(vals ...string) bool {
    	for _, val := range vals {
    		if val != "" && !strings.EqualFold(val, "false") {
    			return true
    		}
    	}
    	return false
    }
    
    func ToStringKey(values ...interface{}) string {
    	results := make([]string, len(values))
    
    	for idx, value := range values {
    		if valuer, ok := value.(driver.Valuer); ok {
    			value, _ = valuer.Value()
    		}
    
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Apr 22 06:43:02 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  2. clause/benchmarks_test.go

    		for _, clause := range clauses {
    			stmt.AddClause(clause)
    		}
    
    		stmt.Build("SELECT", "FROM", "WHERE")
    		_ = stmt.SQL.String()
    	}
    }
    
    func BenchmarkComplexSelect(b *testing.B) {
    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)
  3. schema/naming.go

    	commonInitialismsReplacer *strings.Replacer
    )
    
    func init() {
    	commonInitialismsForReplacer := make([]string, 0, len(commonInitialisms))
    	for _, initialism := range commonInitialisms {
    		commonInitialismsForReplacer = append(commonInitialismsForReplacer, initialism, strings.Title(strings.ToLower(initialism)))
    	}
    	commonInitialismsReplacer = strings.NewReplacer(commonInitialismsForReplacer...)
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Oct 30 09:15:49 GMT 2023
    - 5.2K bytes
    - Viewed (0)
  4. tests/upsert_test.go

    	}
    
    	for idx, lang := range langs {
    		lang.Name = lang.Name + "_new"
    		langs[idx] = lang
    	}
    
    	if err := DB.Clauses(clause.OnConflict{
    		Columns:   []clause.Column{{Name: "code"}},
    		DoUpdates: clause.AssignmentColumns([]string{"name"}),
    	}).Create(&langs).Error; err != nil {
    		t.Fatalf("failed to upsert, got %v", err)
    	}
    
    	for _, lang := range langs {
    		var results []Language
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Mon Sep 05 07:39:19 GMT 2022
    - 11.4K bytes
    - Viewed (0)
  5. tests/callbacks_test.go

    		},
    	}
    
    	for idx, data := range datas {
    		db, err := gorm.Open(nil, nil)
    		if err != nil {
    			t.Fatal(err)
    		}
    		callbacks := db.Callback()
    
    		for _, c := range data.callbacks {
    			var v interface{} = callbacks.Create()
    			callMethod := func(s interface{}, name string, args ...interface{}) {
    				var argValues []reflect.Value
    				for _, arg := range args {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Tue Mar 26 03:33:36 GMT 2024
    - 7.2K bytes
    - Viewed (0)
  6. chainable_api.go

    //
    // [docs]: https://gorm.io/docs/sql_builder.html#Clauses
    func (db *DB) Clauses(conds ...clause.Expression) (tx *DB) {
    	tx = db.getInstance()
    	var whereConds []interface{}
    
    	for _, cond := range conds {
    		if c, ok := cond.(clause.Interface); ok {
    			tx.Statement.AddClause(c)
    		} else if optimizer, ok := cond.(StatementModifier); ok {
    			optimizer.ModifyStatement(tx.Statement)
    		} else {
    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)
  7. clause/select_test.go

    									Value:  18,
    								},
    							},
    						},
    					},
    				},
    			}, clause.From{}},
    			"SELECT `age` = ? as name FROM `users`",
    			[]interface{}{18},
    		},
    	}
    
    	for idx, result := range results {
    		t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) {
    			checkBuildClauses(t, result.Clauses, result.Result, result.Vars)
    		})
    	}
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Sat Feb 18 01:06:43 GMT 2023
    - 1.7K bytes
    - Viewed (0)
  8. tests/hooks_test.go

    	}
    
    	DB.Create(&products)
    
    	for idx, value := range []int64{200, 300, 400} {
    		if products[idx].Price != value {
    			t.Errorf("invalid price for product #%v, expects: %v, got %v", idx, value, products[idx].Price)
    		}
    	}
    
    	DB.Model(&products).Update("Name", "product-name")
    
    	// will set all product's price to last product's price + 10
    	for idx, value := range []int64{410, 410, 410} {
    		if products[idx].Price != value {
    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)
  9. tests/distinct_test.go

    		{Name: "distinct-2", Age: 18},
    		{Name: "distinct-3", Age: 18},
    	}
    
    	if len(results) != 4 {
    		t.Fatalf("invalid results length found, expects: %v, got %v", len(expects), len(results))
    	}
    
    	for idx, expect := range expects {
    		AssertObjEqual(t, results[idx], expect, "Name", "Age")
    	}
    
    	var count int64
    	if err := DB.Model(&User{}).Where("name like ?", "distinct%").Count(&count).Error; err != nil || count != 5 {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Jan 06 07:02:53 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  10. soft_delete.go

    	if _, ok := stmt.Clauses["soft_delete_enabled"]; !ok && !stmt.Statement.Unscoped {
    		if c, ok := stmt.Clauses["WHERE"]; ok {
    			if where, ok := c.Expression.(clause.Where); ok && len(where.Exprs) >= 1 {
    				for _, expr := range where.Exprs {
    					if orCond, ok := expr.(clause.OrConditions); ok && len(orCond.Exprs) == 1 {
    						where.Exprs = []clause.Expression{clause.And(where.Exprs...)}
    						c.Expression = where
    						stmt.Clauses["WHERE"] = c
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Wed Feb 01 06:40:55 GMT 2023
    - 4.5K bytes
    - Viewed (0)
Back to top