Documentation
¶
Index ¶
- Constants
- Variables
- func NewSqlLogger(log logging.Logger) logger.Interface
- func SqlApplyCountQuery(tx *gorm.DB, query *entities.PagingQuery, props []string) *gorm.DB
- func SqlApplyListQuery(tx *gorm.DB, query *entities.PagingQuery, props []string) *gorm.DB
- func SqlTxnFromContext(ctx context.Context, client *gorm.DB) *gorm.DB
- type Database
- type SqlLogger
- func (logger *SqlLogger) Error(ctx context.Context, msg string, args ...interface{})
- func (logger *SqlLogger) Info(ctx context.Context, msg string, args ...interface{})
- func (logger *SqlLogger) LogMode(logger.LogLevel) logger.Interface
- func (logger *SqlLogger) Trace(ctx context.Context, begin time.Time, ...)
- func (logger *SqlLogger) Warn(ctx context.Context, msg string, args ...interface{})
Constants ¶
View Source
const CtxTransaction ctxkey = "kanthor.database.transaction"
Variables ¶
View Source
var ( ErrNotReady = errors.New("DATABASE.NOT_READY.ERROR") ErrNotLive = errors.New("DATABASE.NOT_LIVE.ERROR") ErrAlreadyConnected = errors.New("DATABASE.ALREADY_CONNECTED.ERROR") ErrNotConnected = errors.New("DATABASE.NOT_CONNECTED.ERROR") ErrRecordNotFound = errors.New("DATABASE.RECORD.NOT_FOUND.ERROR") )
Functions ¶
func SqlApplyCountQuery ¶
func SqlApplyListQuery ¶
Types ¶
type Database ¶
type Database interface {
patterns.Connectable
Client() any
}
Click to show internal directories.
Click to hide internal directories.