stdao

package
v0.0.0-...-2a2a1f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetTxToCtx

func SetTxToCtx(ctx context.Context, tx *gorm.DB) context.Context

Types

type Model

type Model struct {
	ID        string `gorm:"primary_key;type:char(26)"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

func (*Model) BeforeCreate

func (m *Model) BeforeCreate(_ *gorm.DB) (err error)

type Std

type Std[T any] struct {
	// contains filtered or unexported fields
}

func (*Std[T]) Begin

func (m *Std[T]) Begin() *gorm.DB

func (*Std[T]) Create

func (m *Std[T]) Create(ctx context.Context, t T) error

func (*Std[T]) DB

func (m *Std[T]) DB() *gorm.DB

func (*Std[T]) Delete

func (m *Std[T]) Delete(ctx context.Context, t T) *gorm.DB

func (*Std[T]) GetTxFromCtx

func (m *Std[T]) GetTxFromCtx(ctx context.Context) *gorm.DB

func (*Std[T]) Init

func (m *Std[T]) Init(db *gorm.DB) error

func (*Std[T]) List

func (m *Std[T]) List(ctx context.Context) (list []T, err error)

func (*Std[T]) SetTxToCtx

func (m *Std[T]) SetTxToCtx(ctx context.Context, tx *gorm.DB) context.Context

func (*Std[T]) UnscopedList

func (m *Std[T]) UnscopedList(ctx context.Context) (list []T, err error)

func (*Std[T]) Update

func (m *Std[T]) Update(ctx context.Context, t T) error

func (*Std[T]) UpdateAll

func (m *Std[T]) UpdateAll(ctx context.Context, t T) error

func (*Std[T]) UpdateAllResult

func (m *Std[T]) UpdateAllResult(ctx context.Context, t T) *gorm.DB

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL