- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for primarily (0.03 sec)
-
tests/generics_test.go
user := User{Name: "TestGenericsCreate", Age: 18} err := gorm.G[User](DB).Create(ctx, &user) if err != nil { t.Fatalf("Create failed: %v", err) } if user.ID == 0 { t.Fatalf("no primary key found for %v", user) } if u, err := gorm.G[User](DB).Where("name = ?", user.Name).First(ctx); err != nil { t.Fatalf("failed to find user, got error: %v", err) } else if u.Name != user.Name || u.ID != user.ID {
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 28K bytes - Viewed (0) -
statement.go
} } // BuildCondition build condition func (stmt *Statement) BuildCondition(query interface{}, args ...interface{}) []clause.Expression { if s, ok := query.(string); ok { // if it is a number, then treats it as primary key if _, err := strconv.Atoi(s); err != nil { if s == "" && len(args) == 0 { return nil } if len(args) == 0 || (len(args) > 0 && strings.Contains(s, "?")) { // looks like a where condition
Registered: Sun Sep 07 09:35:13 UTC 2025 - Last Modified: Thu Sep 04 13:13:16 UTC 2025 - 20.8K bytes - Viewed (0)