Versions in this module Expand all Collapse all v0 v0.0.1 Jan 22, 2024 Changes in this version + type DbSplit struct + func NewDbSplit(cfg MysqlConfig) *DbSplit + func (sp *DbSplit) Close() error + func (sp *DbSplit) Create(v interface{}) *gorm.DB + func (sp *DbSplit) CreateWithContext(ctx context.Context, v interface{}) *gorm.DB + func (sp *DbSplit) GetLogger() *GormLogger + func (sp *DbSplit) Model(v interface{}) *gorm.DB + func (sp *DbSplit) Read() *gorm.DB + func (sp *DbSplit) ReadWithContext(ctx context.Context) *gorm.DB + func (sp *DbSplit) Save(v interface{}) *gorm.DB + func (sp *DbSplit) SaveWithContext(ctx context.Context, v interface{}) *gorm.DB + func (sp *DbSplit) Table(v string) *gorm.DB + func (sp *DbSplit) Transaction(fc func(tx *gorm.DB) error, opts ...*sql.TxOptions) error + func (sp *DbSplit) TransactionWithContext(ctx context.Context, fc func(tx *gorm.DB) error, opts ...*sql.TxOptions) error + func (sp *DbSplit) Write() *gorm.DB + func (sp *DbSplit) WriteWithContext(ctx context.Context) *gorm.DB + type GormLogger struct + CallerSkip int + TracerFunc func(ctx context.Context, begin time.Time, sql string, rowsAffected int64, ...) + func NewLog(level string) *GormLogger + func (l *GormLogger) Error(ctx context.Context, format string, params ...interface{}) + func (l *GormLogger) Info(ctx context.Context, format string, params ...interface{}) + func (l *GormLogger) LogMode(level logger.LogLevel) logger.Interface + func (l *GormLogger) SetTrace(...) + func (l *GormLogger) SetTraceFunc(...) + func (l *GormLogger) Trace(ctx context.Context, begin time.Time, ...) + func (l *GormLogger) Warn(ctx context.Context, format string, params ...interface{}) + type MysqlConfig struct + DataSourceRead string + DataSourceWrite string + LogLevel string + MaxConnIdle int + MaxIdleTime int64 + MaxLeftTime int64 + MaxOpen int