dao

package module
v0.0.0-...-c57de35 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DAO

type DAO[T any] struct{ gen.DO }

DAO model

func New

func New[T any]() *DAO[T]

New new dao

func (DAO[T]) As

func (d DAO[T]) As(alias string) *DAO[T]

func (DAO[T]) Assign

func (d DAO[T]) Assign(attrs ...field.AssignExpr) *DAO[T]

func (DAO[T]) Attrs

func (d DAO[T]) Attrs(attrs ...field.AssignExpr) *DAO[T]

func (DAO[T]) Clauses

func (d DAO[T]) Clauses(conds ...clause.Expression) *DAO[T]

func (DAO[T]) Create

func (d DAO[T]) Create(value *T) error

func (DAO[T]) CreateInBatches

func (d DAO[T]) CreateInBatches(values []*T, batchSize int) error

func (DAO[T]) CreateMany

func (d DAO[T]) CreateMany(values ...*T) error

func (DAO[T]) Debug

func (d DAO[T]) Debug() *DAO[T]

func (DAO[T]) Delete

func (d DAO[T]) Delete() (gen.ResultInfo, error)

func (DAO[T]) Distinct

func (d DAO[T]) Distinct(cols ...field.Expr) *DAO[T]

func (DAO[T]) Find

func (d DAO[T]) Find() ([]*T, error)

func (DAO[T]) FindInBatch

func (d DAO[T]) FindInBatch(batchSize int, fn func(tx gen.Dao, batch int) error) (results []*T, err error)

func (DAO[T]) FindInBatches

func (d DAO[T]) FindInBatches(result *[]*T, batchSize int, fn func(tx gen.Dao, batch int) error) error

func (DAO[T]) First

func (d DAO[T]) First() (*T, error)

func (DAO[T]) FirstOrCreate

func (d DAO[T]) FirstOrCreate() (*T, error)

func (DAO[T]) FirstOrInit

func (d DAO[T]) FirstOrInit() (*T, error)

func (DAO[T]) Group

func (d DAO[T]) Group(cols ...field.Expr) *DAO[T]

func (DAO[T]) Having

func (d DAO[T]) Having(conds ...gen.Condition) *DAO[T]

func (DAO[T]) Join

func (d DAO[T]) Join(table schema.Tabler, on ...field.Expr) *DAO[T]

func (DAO[T]) Joins

func (d DAO[T]) Joins(fields ...field.RelationField) *DAO[T]

func (DAO[T]) Last

func (d DAO[T]) Last() (*T, error)

func (DAO[T]) LeftJoin

func (d DAO[T]) LeftJoin(table schema.Tabler, on ...field.Expr) *DAO[T]

func (DAO[T]) Limit

func (d DAO[T]) Limit(limit int) *DAO[T]

func (DAO[T]) Not

func (d DAO[T]) Not(conds ...gen.Condition) *DAO[T]

func (DAO[T]) Offset

func (d DAO[T]) Offset(offset int) *DAO[T]

func (DAO[T]) Omit

func (d DAO[T]) Omit(cols ...field.Expr) *DAO[T]

func (DAO[T]) Or

func (d DAO[T]) Or(conds ...gen.Condition) *DAO[T]

func (DAO[T]) Order

func (d DAO[T]) Order(conds ...field.Expr) *DAO[T]

func (DAO[T]) Paginate

func (d DAO[T]) Paginate(page int, pageSize int) (*pagination.Paginator[*T], error)

func (DAO[T]) Preload

func (d DAO[T]) Preload(fields ...field.RelationField) *DAO[T]

func (DAO[T]) ReadDB

func (d DAO[T]) ReadDB() *DAO[T]

func (DAO[T]) Returning

func (d DAO[T]) Returning(value any, columns ...string) *DAO[T]

func (DAO[T]) RightJoin

func (d DAO[T]) RightJoin(table schema.Tabler, on ...field.Expr) *DAO[T]

func (DAO[T]) Save

func (d DAO[T]) Save(value *T) error

func (DAO[T]) SaveMany

func (d DAO[T]) SaveMany(values ...*T) error

func (DAO[T]) Scopes

func (d DAO[T]) Scopes(scopes ...func(gen.Dao) gen.Dao) *DAO[T]

func (DAO[T]) Select

func (d DAO[T]) Select(conds ...field.Expr) *DAO[T]

func (DAO[T]) Session

func (d DAO[T]) Session(config *gorm.Session) *DAO[T]

func (DAO[T]) Take

func (d DAO[T]) Take() (*T, error)

func (DAO[T]) Unscoped

func (d DAO[T]) Unscoped() *DAO[T]

func (DAO[T]) UseConn

func (d DAO[T]) UseConn(connection *database.Connection) *DAO[T]

UseConn set connection

func (DAO[T]) UseDB

func (d DAO[T]) UseDB(db *gorm.DB) *DAO[T]

UseDB set db

func (DAO[T]) UseTable

func (d DAO[T]) UseTable(tableName string) *DAO[T]

func (DAO[T]) UseTx

func (d DAO[T]) UseTx(tx *gorm.DB) *DAO[T]

func (DAO[T]) Where

func (d DAO[T]) Where(conds ...gen.Condition) *DAO[T]

func (DAO[T]) WithContext

func (d DAO[T]) WithContext(ctx context.Context) *DAO[T]

func (DAO[T]) WriteDB

func (d DAO[T]) WriteDB() *DAO[T]

Jump to

Keyboard shortcuts

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