dao

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package dao is the data access object, the code for database operation is unified here.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserExampleDao

type UserExampleDao interface {
	Create(ctx context.Context, table *model.UserExample) error
	DeleteByID(ctx context.Context, id uint64) error
	DeleteByIDs(ctx context.Context, ids []uint64) error
	UpdateByID(ctx context.Context, table *model.UserExample) error
	GetByID(ctx context.Context, id uint64) (*model.UserExample, error)
	GetByCondition(ctx context.Context, condition *query.Conditions) (*model.UserExample, error)
	GetByIDs(ctx context.Context, ids []uint64) (map[uint64]*model.UserExample, error)
	GetByLastID(ctx context.Context, lastID uint64, limit int, sort string) ([]*model.UserExample, error)
	GetByColumns(ctx context.Context, params *query.Params) ([]*model.UserExample, int64, error)

	CreateByTx(ctx context.Context, tx *gorm.DB, table *model.UserExample) (uint64, error)
	DeleteByTx(ctx context.Context, tx *gorm.DB, id uint64) error
	UpdateByTx(ctx context.Context, tx *gorm.DB, table *model.UserExample) error
}

UserExampleDao defining the dao interface

func NewUserExampleDao

func NewUserExampleDao(db *gorm.DB, xCache cache.UserExampleCache) UserExampleDao

NewUserExampleDao creating the dao interface

Jump to

Keyboard shortcuts

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