Documentation ¶
Index ¶
- type Std
- func (s *Std[T]) Begin() *Std[T]
- func (s *Std[T]) Commit() (result *gorm.DB)
- func (s *Std[T]) Count() (count int64)
- func (s *Std[T]) Create(model T, tx ...*gorm.DB) (result *gorm.DB)
- func (s *Std[T]) DB() *gorm.DB
- func (s *Std[T]) Debug() *Std[T]
- func (s *Std[T]) Delete(model T, tx ...*gorm.DB) (result *gorm.DB)
- func (s *Std[T]) Find(model T, tx ...*gorm.DB) (result *gorm.DB)
- func (s *Std[T]) First(model T, tx ...*gorm.DB) (result *gorm.DB)
- func (s *Std[T]) Get(key string) (interface{}, bool)
- func (s *Std[T]) Init(db *gorm.DB) (err error)
- func (s *Std[T]) List(where []clause.Expression, order []clause.OrderByColumn, page page.Paginate, ...) (list []T, result *gorm.DB)
- func (s *Std[T]) Pluck(column string, dest interface{}) *gorm.DB
- func (s *Std[T]) Rollback() (result *gorm.DB)
- func (s *Std[T]) Save(model T, tx ...*gorm.DB) (result *gorm.DB)
- func (s *Std[T]) Session(session *gorm.Session) *Std[T]
- func (s *Std[T]) Set(key string, value interface{}) *Std[T]
- func (s *Std[T]) Transaction(fc func(tx *Std[T]) error) (err error)
- func (s *Std[T]) Update(model T, tx ...*gorm.DB) (result *gorm.DB)
- func (s *Std[T]) Updates(model T, m map[string]interface{}, tx ...*gorm.DB) (result *gorm.DB)
- func (s *Std[T]) Use(plugin gorm.Plugin) (err error)
- func (s *Std[T]) Where(query any, args ...any) (result *gorm.DB)
- func (s *Std[T]) WhereByPredicateModel(predicateModel T) (result *gorm.DB)
- func (s *Std[T]) WithCtx(ctx context.Context) *Std[T]
- func (s *Std[T]) WithMigrator(mf func(db *gorm.DB) error)
- type StdWithCache
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Std ¶
type Std[T any] struct { // contains filtered or unexported fields }
func (*Std[T]) Pluck ¶ added in v1.2.0
Pluck queries a single column from a model, returning in the slice dest. E.g.: var ages []int64 db.Model(&users).Pluck("age", &ages)
func (*Std[T]) Transaction ¶
Transaction start a transaction as a block, return any error will rollback the transaction
func (*Std[T]) WhereByPredicateModel ¶ added in v1.2.0
type StdWithCache ¶
type StdWithCache[T any] struct { Std[T] cache.StatsAccessor }
func CreateWithCache ¶
func CreateWithCache[T any](m T) StdWithCache[T]
func (*StdWithCache[T]) Init ¶
func (s *StdWithCache[T]) Init(db *gorm.DB, cacheConfig *config.CacheConfig) (err error)
Click to show internal directories.
Click to hide internal directories.