mysqldb

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCheckExistsError = errors.New("BaseService.Exists方法调用出错")
View Source
var ErrModelOrTableParamValid = errors.New("BaseService.GetTable参数modelOrTable只支持schema.Tabler和string类型")
View Source
var ErrRecordNotFound = errors.New("记录不存在")

Functions

This section is empty.

Types

type BaseService

type BaseService struct {
}

func (*BaseService) Exists

func (svc *BaseService) Exists(db *gorm.DB, modelOrTable any, exist *bool, where string, args ...any) error

Exists 检查数据是否存在

func (*BaseService) GetFieldValue

func (svc *BaseService) GetFieldValue(db *gorm.DB, modelOrTable any, field string, id any, where string, args ...any) error

func (*BaseService) GetFieldValues

func (svc *BaseService) GetFieldValues(db *gorm.DB, modelOrTable any, field string, where string, args ...any) (values []any, err error)

func (*BaseService) GetTable

func (svc *BaseService) GetTable(db *gorm.DB, modelOrTable any) (*gorm.DB, error)

Jump to

Keyboard shortcuts

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