orm

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBaseConfig

func GetBaseConfig(c framework.Container) *contract.DBConfig

从database.yaml文件中读取数据

func NewAnanGorm

func NewAnanGorm(params ...interface{}) (interface{}, error)

func WithConfigPath

func WithConfigPath(configPath string) contract.DBoption

加载配置文件地址

Types

type AnanGorm

type AnanGorm struct {
	// contains filtered or unexported fields
}

AnanOrm 代表anan框架的orm实现

func (*AnanGorm) GetDB

func (a *AnanGorm) GetDB(option ...contract.DBoption) (*gorm.DB, error)

type GormProvider

type GormProvider struct {
}

提供App的具体实现方法

func (*GormProvider) Boot

func (a *GormProvider) Boot(container framework.Container) error

func (*GormProvider) IsDefer

func (a *GormProvider) IsDefer() bool

func (*GormProvider) Name

func (a *GormProvider) Name() string

func (*GormProvider) Params

func (a *GormProvider) Params(container framework.Container) []interface{}

func (*GormProvider) Register

func (a *GormProvider) Register(container framework.Container) framework.NewInstance

type OrmLogger

type OrmLogger struct {
	// contains filtered or unexported fields
}

OrmLogger orm的日志实现类, 实现了gorm.Logger.Interface

func NewOrmLogger

func NewOrmLogger(logger contract.Log) *OrmLogger

func (*OrmLogger) Error

func (ol *OrmLogger) Error(ctx context.Context, s string, i ...interface{})

func (*OrmLogger) Info

func (ol *OrmLogger) Info(ctx context.Context, s string, i ...interface{})

func (*OrmLogger) LogMode

func (ol *OrmLogger) LogMode(level logger.LogLevel) logger.Interface

func (*OrmLogger) Trace

func (ol *OrmLogger) Trace(ctx context.Context, begin time.Time, fc func() (sql string, rowsAffected int64), err error)

func (*OrmLogger) Warn

func (ol *OrmLogger) Warn(ctx context.Context, s string, i ...interface{})

Jump to

Keyboard shortcuts

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