This commit is contained in:
parent
d32818af09
commit
cfa0566c6d
39 changed files with 2276 additions and 183 deletions
|
@ -6,6 +6,7 @@ package dbgen
|
|||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
|
||||
"git.mstar.dev/mstar/linstrom/storage-new/models"
|
||||
"gorm.io/gorm"
|
||||
|
@ -299,11 +300,14 @@ func (u *userRemoteLinks) fillFieldMap() {
|
|||
|
||||
func (u userRemoteLinks) clone(db *gorm.DB) userRemoteLinks {
|
||||
u.userRemoteLinksDo.ReplaceConnPool(db.Statement.ConnPool)
|
||||
u.User.db = db.Session(&gorm.Session{Initialized: true})
|
||||
u.User.db.Statement.ConnPool = db.Statement.ConnPool
|
||||
return u
|
||||
}
|
||||
|
||||
func (u userRemoteLinks) replaceDB(db *gorm.DB) userRemoteLinks {
|
||||
u.userRemoteLinksDo.ReplaceDB(db)
|
||||
u.User.db = db.Session(&gorm.Session{})
|
||||
return u
|
||||
}
|
||||
|
||||
|
@ -416,6 +420,11 @@ func (a userRemoteLinksBelongsToUser) Model(m *models.UserRemoteLinks) *userRemo
|
|||
return &userRemoteLinksBelongsToUserTx{a.db.Model(m).Association(a.Name())}
|
||||
}
|
||||
|
||||
func (a userRemoteLinksBelongsToUser) Unscoped() *userRemoteLinksBelongsToUser {
|
||||
a.db = a.db.Unscoped()
|
||||
return &a
|
||||
}
|
||||
|
||||
type userRemoteLinksBelongsToUserTx struct{ tx *gorm.Association }
|
||||
|
||||
func (a userRemoteLinksBelongsToUserTx) Find() (result *models.User, err error) {
|
||||
|
@ -454,6 +463,11 @@ func (a userRemoteLinksBelongsToUserTx) Count() int64 {
|
|||
return a.tx.Count()
|
||||
}
|
||||
|
||||
func (a userRemoteLinksBelongsToUserTx) Unscoped() *userRemoteLinksBelongsToUserTx {
|
||||
a.tx = a.tx.Unscoped()
|
||||
return &a
|
||||
}
|
||||
|
||||
type userRemoteLinksDo struct{ gen.DO }
|
||||
|
||||
type IUserRemoteLinksDo interface {
|
||||
|
@ -511,6 +525,8 @@ type IUserRemoteLinksDo interface {
|
|||
FirstOrCreate() (*models.UserRemoteLinks, error)
|
||||
FindByPage(offset int, limit int) (result []*models.UserRemoteLinks, count int64, err error)
|
||||
ScanByPage(result interface{}, offset int, limit int) (count int64, err error)
|
||||
Rows() (*sql.Rows, error)
|
||||
Row() *sql.Row
|
||||
Scan(result interface{}) (err error)
|
||||
Returning(value interface{}, columns ...string) IUserRemoteLinksDo
|
||||
UnderlyingDB() *gorm.DB
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue