Work on AS activities and objects
All checks were successful
/ docker (push) Successful in 4m15s

This commit is contained in:
Melody Becker 2025-04-29 21:35:58 +02:00
parent d32818af09
commit cfa0566c6d
Signed by: mstar
SSH key fingerprint: SHA256:vkXfS9FG2pVNVfvDrzd1VW9n8VJzqqdKQGljxxX8uK8
39 changed files with 2276 additions and 183 deletions

View file

@ -6,6 +6,7 @@ package dbgen
import (
"context"
"database/sql"
"git.mstar.dev/mstar/linstrom/storage-new/models"
"gorm.io/gorm"
@ -259,11 +260,14 @@ func (u *userToBeing) fillFieldMap() {
func (u userToBeing) clone(db *gorm.DB) userToBeing {
u.userToBeingDo.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 userToBeing) replaceDB(db *gorm.DB) userToBeing {
u.userToBeingDo.ReplaceDB(db)
u.User.db = db.Session(&gorm.Session{})
return u
}
@ -376,6 +380,11 @@ func (a userToBeingBelongsToUser) Model(m *models.UserToBeing) *userToBeingBelon
return &userToBeingBelongsToUserTx{a.db.Model(m).Association(a.Name())}
}
func (a userToBeingBelongsToUser) Unscoped() *userToBeingBelongsToUser {
a.db = a.db.Unscoped()
return &a
}
type userToBeingBelongsToUserTx struct{ tx *gorm.Association }
func (a userToBeingBelongsToUserTx) Find() (result *models.User, err error) {
@ -414,6 +423,11 @@ func (a userToBeingBelongsToUserTx) Count() int64 {
return a.tx.Count()
}
func (a userToBeingBelongsToUserTx) Unscoped() *userToBeingBelongsToUserTx {
a.tx = a.tx.Unscoped()
return &a
}
type userToBeingDo struct{ gen.DO }
type IUserToBeingDo interface {
@ -471,6 +485,8 @@ type IUserToBeingDo interface {
FirstOrCreate() (*models.UserToBeing, error)
FindByPage(offset int, limit int) (result []*models.UserToBeing, 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) IUserToBeingDo
UnderlyingDB() *gorm.DB