- Sort Score
- Result 10 results
- Languages All
Results 1 - 1 of 1 for RowUser3 (0.14 sec)
-
tests/sql_builder_test.go
"gorm.io/gorm" "gorm.io/gorm/clause" . "gorm.io/gorm/utils/tests" ) func TestRow(t *testing.T) { user1 := User{Name: "RowUser1", Age: 1} user2 := User{Name: "RowUser2", Age: 10} user3 := User{Name: "RowUser3", Age: 20} DB.Save(&user1).Save(&user2).Save(&user3) row := DB.Table("users").Where("name = ?", user2.Name).Select("age").Row() var age int64 if err := row.Scan(&age); err != nil {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Jan 12 08:42:21 UTC 2024 - 16.7K bytes - Viewed (0)