- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 56 for Jinzhu (0.15 sec)
-
schema/constraint_test.go
import ( "reflect" "sync" "testing" "gorm.io/gorm/schema" "gorm.io/gorm/utils/tests" ) type UserCheck struct { Name string `gorm:"check:name_checker,name <> 'jinzhu'"` Name2 string `gorm:"check:name <> 'jinzhu'"` Name3 string `gorm:"check:,name <> 'jinzhu'"` } func TestParseCheck(t *testing.T) { user, err := schema.Parse(&UserCheck{}, &sync.Map{}, schema.NamingStrategy{}) if err != nil {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sun Feb 04 07:49:19 UTC 2024 - 2.2K bytes - Viewed (0) -
tests/named_argument_test.go
if err := DB.Exec("UPDATE named_users SET name1 = @name, name2 = @name2, name3 = @name", sql.Named("name", "jinzhu-new"), sql.Named("name2", "jinzhu-new2")).Error; err != nil { t.Errorf("failed to update with named arg") } namedUser.Name1 = "jinzhu-new" namedUser.Name2 = "jinzhu-new2" namedUser.Name3 = "jinzhu-new" var result5 NamedUser
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Dec 21 11:50:00 UTC 2021 - 2.7K bytes - Viewed (0) -
chainable_api.go
// // // Find the first user with name jinzhu // db.Where("name = ?", "jinzhu").First(&user) // // Find the first user with name jinzhu and age 20 // db.Where(&User{Name: "jinzhu", Age: 20}).First(&user) // // Find the first user with name jinzhu and age not equal to 20 // db.Where("name = ?", "jinzhu").Where("age <> ?", "20").First(&user) //
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 24 09:42:59 UTC 2024 - 14.8K bytes - Viewed (0) -
go.sum
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 12 03:46:59 UTC 2024 - 491 bytes - Viewed (0) -
tests/query_test.go
} result = dryDB.Where("name = ?", "jinzhu").Or(User{Name: "jinzhu 2", Age: 18}).Find(&User{}) if !regexp.MustCompile("SELECT \\* FROM .*users.* WHERE .*name.* = .+ OR \\(.*name.* AND .*age.*\\)").MatchString(result.Statement.SQL.String()) { t.Fatalf("Build OR condition, but got %v", result.Statement.SQL.String()) } result = dryDB.Where("name = ?", "jinzhu").Or(map[string]interface{}{"name": "jinzhu 2", "age": 18}).Find(&User{})
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 24 09:42:59 UTC 2024 - 50.4K bytes - Viewed (0) -
clause/expression_test.go
}, { SQL: "@@test AND name1 = @name1 AND name2 = @name2 AND name3 = @name1 @notexist", Vars: []interface{}{sql.Named("name1", "jinzhu"), sql.Named("name2", "jinzhu2")}, Result: "@@test AND name1 = ? AND name2 = ? AND name3 = ? @notexist", ExpectedVars: []interface{}{"jinzhu", "jinzhu2", "jinzhu"}, }, {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Aug 10 05:34:33 UTC 2023 - 8.4K bytes - Viewed (0) -
clause/set_test.go
}, { []clause.Interface{ clause.Update{}, clause.Set([]clause.Assignment{{clause.PrimaryColumn, 1}}), clause.Set([]clause.Assignment{{clause.Column{Name: "name"}, "jinzhu"}}), }, "UPDATE `users` SET `name`=?", []interface{}{"jinzhu"}, }, } for idx, result := range results { t.Run(fmt.Sprintf("case #%v", idx), func(t *testing.T) { checkBuildClauses(t, result.Clauses, result.Result, result.Vars)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Jan 06 07:02:53 UTC 2022 - 1.4K bytes - Viewed (0) -
go.mod
module gorm.io/gorm go 1.18 require ( github.com/jinzhu/inflection v1.0.0 github.com/jinzhu/now v1.1.5 golang.org/x/text v0.14.0
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 12 03:46:59 UTC 2024 - 136 bytes - Viewed (0) -
tests/scanner_valuer_test.go
t.Errorf("insert with sql.Expr, but got %v", stmt.SQL.String()) } if !reflect.DeepEqual([]interface{}{"jinzhu", "POINT(100 100)"}, stmt.Vars) { t.Errorf("generated vars is not equal, got %v", stmt.Vars) } stmt = dryRunDB.Model(UserWithPoint{}).Create(map[string]interface{}{ "Name": "jinzhu", "Point": clause.Expr{SQL: "ST_PointFromText(?)", Vars: []interface{}{"POINT(100 100)"}}, }).Statement
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 07 07:02:07 UTC 2023 - 10.6K bytes - Viewed (0) -
tests/go.mod
module gorm.io/gorm/tests go 1.18 require ( github.com/google/uuid v1.6.0 github.com/jinzhu/now v1.1.5 github.com/lib/pq v1.10.9 github.com/stretchr/testify v1.9.0 gorm.io/driver/mysql v1.5.7 gorm.io/driver/postgres v1.5.9 gorm.io/driver/sqlite v1.5.6 gorm.io/driver/sqlserver v1.5.3 gorm.io/gorm v1.25.12 ) require ( filippo.io/edwards25519 v1.1.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Sep 18 12:03:35 UTC 2024 - 1.3K bytes - Viewed (0)