- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 50 for statement (0.21 sec)
-
statement.go
subdb := v.Session(&Session{Logger: logger.Discard, DryRun: true}).getInstance() if v.Statement.SQL.Len() > 0 { var ( vars = subdb.Statement.Vars sql = v.Statement.SQL.String() ) subdb.Statement.Vars = make([]interface{}, 0, len(vars)) for _, vv := range vars { subdb.Statement.Vars = append(subdb.Statement.Vars, vv) bindvar := strings.Builder{}
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 19.8K bytes - Viewed (0) -
statement_test.go
"testing" "gorm.io/gorm/clause" ) func TestWhereCloneCorruption(t *testing.T) { for whereCount := 1; whereCount <= 8; whereCount++ { t.Run(fmt.Sprintf("w=%d", whereCount), func(t *testing.T) { s := new(Statement) for w := 0; w < whereCount; w++ { s = s.clone() s.AddClause(clause.Where{ Exprs: s.BuildCondition(fmt.Sprintf("where%d", w)), }) } s1 := s.clone() s1.AddClause(clause.Where{
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Sat Dec 23 13:19:41 GMT 2023 - 1.9K bytes - Viewed (0) -
callbacks/callmethod.go
tx := db.Session(&gorm.Session{NewDB: true}) if called := fc(db.Statement.ReflectValue.Interface(), tx); !called { switch db.Statement.ReflectValue.Kind() { case reflect.Slice, reflect.Array: db.Statement.CurDestIndex = 0 for i := 0; i < db.Statement.ReflectValue.Len(); i++ { if value := reflect.Indirect(db.Statement.ReflectValue.Index(i)); value.CanAddr() { fc(value.Addr().Interface(), tx) } else {
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Sat Feb 18 01:20:29 GMT 2023 - 846 bytes - Viewed (0) -
scan.go
if isArrayKind { db.Statement.ReflectValue.Set(reflect.Zero(reflectValue.Type())) } else { // if the slice cap is externally initialized, the externally initialized slice is directly used here if reflectValue.Cap() == 0 { db.Statement.ReflectValue.Set(reflect.MakeSlice(reflectValue.Type(), 0, 20)) } else { reflectValue.SetLen(0) db.Statement.ReflectValue.Set(reflectValue) }
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Fri Mar 15 06:14:48 GMT 2024 - 9.8K bytes - Viewed (0) -
tests/scanner_valuer_test.go
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Wed Jun 07 07:02:07 GMT 2023 - 10.6K bytes - Viewed (0) -
callbacks/query.go
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 for _, primaryField := range db.Statement.Schema.PrimaryFields {
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Mon Jan 29 03:34:57 GMT 2024 - 9.9K bytes - Viewed (0) -
callbacks/associations.go
if _, zero := rel.Field.ValueOf(db.Statement.Context, db.Statement.ReflectValue); !zero { rv := rel.Field.ReflectValueOf(db.Statement.Context, db.Statement.ReflectValue) // relation reflect value if rv.Kind() != reflect.Ptr { rv = rv.Addr() } if saveAssociations(db, rel, rv, selectColumns, restricted, nil) == nil { setupReferences(db.Statement.ReflectValue, rv) } } }
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Tue Apr 11 03:06:13 GMT 2023 - 14.3K bytes - Viewed (0) -
chainable_api.go
j := join{ Name: query, Conds: args, Selects: db.Statement.Selects, Omits: db.Statement.Omits, JoinType: joinType, } if where, ok := db.Statement.Clauses["WHERE"].Expression.(clause.Where); ok { j.On = &where } tx.Statement.Joins = append(tx.Statement.Joins, j) return } } tx.Statement.Joins = append(tx.Statement.Joins, join{Name: query, Conds: args, JoinType: joinType}) return
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Wed Apr 17 03:38:55 GMT 2024 - 14.3K bytes - Viewed (1) -
tests/count_test.go
t.Fatalf("Build count with select, but got %v", result.Statement.SQL.String()) } result = dryDB.Table("users").Distinct("name").Count(&count) if !regexp.MustCompile(`SELECT COUNT\(DISTINCT\(.name.\)\) FROM .*users.*`).MatchString(result.Statement.SQL.String()) { t.Fatalf("Build count with select, but got %v", result.Statement.SQL.String()) } var count4 int64
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Mon Oct 30 09:15:49 GMT 2023 - 6.9K bytes - Viewed (0) -
callbacks/helper_test.go
Values: [][]interface{}{{true}}, }, }, } for _, tc := range testCase { t.Run(tc.name, func(t *testing.T) { actual := ConvertMapToValuesForCreate(&gorm.Statement{}, tc.input) if !reflect.DeepEqual(actual, tc.expect) { t.Errorf("expect %v got %v", tc.expect, actual) } }) } } func TestConvertSliceOfMapToValuesForCreate(t *testing.T) {
Go - Registered: Sun Apr 21 09:35:09 GMT 2024 - Last Modified: Tue Mar 05 02:22:57 GMT 2024 - 3.4K bytes - Viewed (0)