- Sort Score
- Result 10 results
- Languages All
Results 1 - 8 of 8 for What (0.4 sec)
-
tests/sql_builder_test.go
Columns: []clause.OrderByColumn{{Column: clause.Column{Name: "id", Raw: true}, Desc: true}}, }) }) assertEqualSQL(t, `SELECT * FROM users ORDER BY id DESC`, sql) } // assertEqualSQL for assert that the sql is equal, this method will ignore quote, and dialect specials. func assertEqualSQL(t *testing.T, expected string, actually string) { t.Helper() // replace SQL quote, convert into postgresql like ""
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Fri Jan 12 08:42:21 UTC 2024 - 16.7K bytes - Viewed (0) -
tests/hooks_test.go
t.Fatalf("An error from before create callbacks happened when create with invalid value") } if DB.Where("code = ?", "Invalid").First(&Product{}).Error == nil { t.Fatalf("Should not save record that have errors") } if DB.Save(&Product{Code: "dont_save", Price: 100}).Error == nil { t.Fatalf("An error from after create callbacks happened when create with invalid value") }
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Sat Feb 18 01:20:29 UTC 2023 - 15.9K bytes - Viewed (0) -
tests/create_test.go
GetUser("invalid_slice_2", Config{}), nil, } if err := DB.Create(&users).Error; !errors.Is(err, gorm.ErrInvalidData) { t.Errorf("should returns error invalid data when creating from slice that contains invalid data") } } func TestCreateWithExistingTimestamp(t *testing.T) { user := User{Name: "CreateUserExistingTimestamp"} curTime := now.MustParse("2016-01-01") user.CreatedAt = curTime
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Tue Mar 19 03:50:28 UTC 2024 - 26.4K bytes - Viewed (0) -
chainable_api.go
// // // update all users's name to `hello` // db.Model(&User{}).Update("name", "hello") // // if user's primary key is non-blank, will use it as condition, then will only update that user's name to `hello` // db.Model(&user).Update("name", "hello") func (db *DB) Model(value interface{}) (tx *DB) { tx = db.getInstance() tx.Statement.Model = value return } // Clauses Add clauses //
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Wed Jun 12 09:47:34 UTC 2024 - 14.5K bytes - Viewed (0) -
migrator/migrator.go
"gorm.io/gorm/schema" ) // This regular expression seeks to find a sequence of digits (\d+) among zero or more non-digit characters (\D*), // with a possible trailing non-digit character (\D?). // For example, values that can pass this regular expression are: // - "123" // - "abc456" // -"%$#@789" var regFullDataType = regexp.MustCompile(`\D*(\d+)\D?`) // TODO:? Create const vars for raw sql queries ?
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Fri Apr 26 07:15:49 UTC 2024 - 29K bytes - Viewed (0) -
logger/sql.go
nullStr = "NULL" ) func isPrintable(s string) bool { for _, r := range s { if !unicode.IsPrint(r) { return false } } return true } // A list of Go types that should be converted to SQL primitives var convertibleTypes = []reflect.Type{reflect.TypeOf(time.Time{}), reflect.TypeOf(false), reflect.TypeOf([]byte{})} // RegEx matches only numeric values
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Thu Mar 21 08:00:02 UTC 2024 - 5K bytes - Viewed (0) -
schema/schema.go
} } } return schema, schema.err } // This unrolling is needed to show to the compiler the exact set of methods // that can be used on the modelType. // Prior to go1.22 any use of MethodByName would cause the linker to // abandon dead code elimination for the entire binary. // As of go1.22 the compiler supports one special case of a string constant
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Wed Jun 12 10:52:33 UTC 2024 - 13.7K bytes - Viewed (0) -
tests/update_test.go
DB.Create(&user) // Update a single field of the user and verify that the changed address is not stored. newAge := uint(100) user.Account.Number = "new_account_number" db := DB.Model(&user).UpdateColumns(User{Age: newAge}) if db.RowsAffected != 1 { t.Errorf("Expected RowsAffected=1 but instead RowsAffected=%v", db.RowsAffected) } // Verify that Age now=`newAge`. result := &User{} result.ID = user.ID
Registered: Wed Jun 12 16:27:09 UTC 2024 - Last Modified: Mon Dec 04 03:50:58 UTC 2023 - 30.3K bytes - Viewed (0)