Documentation ¶
Index ¶
- Constants
- Variables
- func CreateDBName(conf config.Config) string
- func GetDBFromCtx(ctx context.Context) *gorm.DB
- func MustOpenGORM(conf config.Config, dbName string, lf *log.LoggerFactory) *gorm.DB
- func NewGooseLogger(logger log.Logger) goose.Logger
- func NewGormLogger(logger log.Logger) gormlogger.Interface
- func OnDBStop(db DB) error
- type DB
- type DBTx
Constants ¶
View Source
const ( ErrCodeCommitFailed = "DB_COMMIT_FAILED" ErrCodeRollbackFailed = "DB_ROLLBACK_FAILED" )
Variables ¶
View Source
var ( DBCtxKey = context.CtxKey("_fw_db") DBTxCtxKey = context.CtxKey("_fw_db_tx") )
Functions ¶
func CreateDBName ¶
func MustOpenGORM ¶
func NewGooseLogger ¶
func NewGormLogger ¶
func NewGormLogger(logger log.Logger) gormlogger.Interface
Types ¶
type DB ¶
func NewDB ¶
func NewDB(conf config.Config, lf *log.LoggerFactory) DB
NewDB creates a new database instance
func (DB) HealthCheck ¶
type DBTx ¶
func GetDBTxFromCtx ¶
func (*DBTx) DeferredCommitOrRollback ¶
func (*DBTx) IsAutomatic ¶
Click to show internal directories.
Click to hide internal directories.