- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for attr (0.12 sec)
-
tests/upsert_test.go
t.Errorf("user should be initialized with search value and assign attrs") } DB.Save(&User{Name: "find or init", Age: 33}) DB.Where(&User{Name: "find or init"}).Attrs("age", 44).FirstOrInit(&user5) if user5.Name != "find or init" || user5.ID == 0 || user5.Age != 33 { t.Errorf("user should be found and not initialized by Attrs") } DB.Where(&User{Name: "find or init", Age: 33}).FirstOrInit(&user6)
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) -
chainable_api.go
// db.Where(User{Name: "jinzhu"}).Attrs(User{Email: "******@****.***"}).FirstOrInit(&user) // // user -> User{Name: "jinzhu", Age: 20} // // [FirstOrCreate]: https://gorm.io/docs/advanced_query.html#FirstOrCreate // [FirstOrInit]: https://gorm.io/docs/advanced_query.html#FirstOrInit func (db *DB) Attrs(attrs ...interface{}) (tx *DB) { tx = db.getInstance() tx.Statement.attrs = attrs return }
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) -
finisher_api.go
if where, ok := c.Expression.(clause.Where); ok { tx.assignInterfacesToValue(where.Exprs) } } // initialize with attrs, conds if len(tx.Statement.attrs) > 0 { tx.assignInterfacesToValue(tx.Statement.attrs...) } } // initialize with attrs, conds if len(tx.Statement.assigns) > 0 { tx.assignInterfacesToValue(tx.Statement.assigns...) } return }
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 22.7K bytes - Viewed (0) -
clause/select.go
package clause // Select select attrs when querying, updating, creating type Select struct { Distinct bool Columns []Column Expression Expression } func (s Select) Name() string { return "SELECT" } func (s Select) Build(builder Builder) { if len(s.Columns) > 0 { if s.Distinct { builder.WriteString("DISTINCT ") } for idx, column := range s.Columns { if idx > 0 { builder.WriteByte(',')
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Wed Jul 14 07:51:24 GMT 2021 - 1.1K bytes - Viewed (0) -
statement.go
Go - Registered: Sun May 05 09:35:13 GMT 2024 - Last Modified: Fri Jan 12 08:42:21 GMT 2024 - 19.8K bytes - Viewed (0)