Documentation
¶
Index ¶
- func EntDriver(cfg *config.DB) *entsql.Driver
- func EntNativeDB() *nativeSQL.DB
- func GenerateDAO(cfg *config.DB, savePath string, hook func(*gen.Generator))
- func GetDSN(cfg *config.DB) string
- func GormDB() *gorm.DB
- func InitGORM(cfg *config.DB)
- func InitSqlx(cfg *config.DB)
- func SqlxDB() *sqlx.DB
- type GormLogger
- func (g *GormLogger) Error(ctx context.Context, msg string, data ...interface{})
- func (g *GormLogger) Info(ctx context.Context, msg string, data ...interface{})
- func (g *GormLogger) LogMode(level logger.LogLevel) logger.Interface
- func (g *GormLogger) Trace(ctx context.Context, begin time.Time, fc func() (string, int64), err error)
- func (g *GormLogger) Warn(ctx context.Context, msg string, data ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGORM ¶
InitGORM 初始化MySQL连接 dns refer https://github.com/go-sql-driver/mysql#dsn-data-source-name for details
Types ¶
type GormLogger ¶
type GormLogger struct {
// contains filtered or unexported fields
}
func NewGormLoggerDebug ¶
func NewGormLoggerDebug() *GormLogger
func NewGormLoggerRelease ¶
func NewGormLoggerRelease() *GormLogger
func (*GormLogger) Error ¶
func (g *GormLogger) Error(ctx context.Context, msg string, data ...interface{})
func (*GormLogger) Info ¶
func (g *GormLogger) Info(ctx context.Context, msg string, data ...interface{})
Click to show internal directories.
Click to hide internal directories.