orm

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "orm"

Variables

This section is empty.

Functions

func ScanSqlRows

func ScanSqlRows(rows *sql.Rows) []map[string]*castkit.GoodleVal

扫描获取结果集

Types

type OrmLogger

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

自定义 gorm 的日志实现类, 实现了 gorm.Logger.Interface

func (*OrmLogger) Error

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

func (*OrmLogger) Info

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

func (*OrmLogger) Trace

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

func (*OrmLogger) Warn

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

type OrmProvider

type OrmProvider struct {
	core.ServiceProvider
}

func (*OrmProvider) AfterInit

func (*OrmProvider) AfterInit(instance any) error

func (*OrmProvider) BeforeInit

func (*OrmProvider) BeforeInit(c core.Container) error

func (*OrmProvider) InitOnBind

func (*OrmProvider) InitOnBind() bool

func (*OrmProvider) Name

func (self *OrmProvider) Name() string

func (*OrmProvider) Params

func (*OrmProvider) Params(c core.Container) []interface{}

func (*OrmProvider) RegisterProviderInstance

func (*OrmProvider) RegisterProviderInstance(c core.Container) core.NewInstanceFunc

type OrmService

type OrmService struct {
	Service
	// contains filtered or unexported fields
}

func (*OrmService) GetConnPool

func (self *OrmService) GetConnPool(connName ...string) *gorm.DB

type Service

type Service interface {
	GetConnPool(option ...string) *gorm.DB
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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