- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for subquery_1 (0.42 sec)
-
tests/create_test.go
user := User{Name: "jinzhu"} DB.Create(&user) subQuery := DB.Table("users").Where("name=?", user.Name).Select("id") result := DB.Session(&gorm.Session{DryRun: true}).Model(&Pet{}).Create([]map[string]interface{}{ { "name": "cat", "user_id": gorm.Expr("(?)", DB.Table("(?) as tmp", subQuery).Select("@uid:=id")), }, { "name": "dog", "user_id": gorm.Expr("@uid"),
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Mar 19 03:50:28 UTC 2024 - 26.4K bytes - Viewed (0) -
migrator/migrator.go
// q := DB.Model(&User{}) // DB.Debug().Migrator().CreateView("user_view", gorm.ViewOption{Query: q, Replace: true, CheckOption: "WITH CHECK OPTION"}) // // [subquery]: https://gorm.io/docs/advanced_query.html#SubQuery func (m Migrator) CreateView(name string, option gorm.ViewOption) error { if option.Query == nil { return gorm.ErrSubQueryRequired } sql := new(strings.Builder)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Apr 26 07:15:49 UTC 2024 - 29K bytes - Viewed (0)