Versions in this module Expand all Collapse all v1 v1.0.1 Feb 8, 2024 v1.0.0 Feb 8, 2024 Changes in this version + func Count(ctx context.Context, db *gorm.DB, table interface{}, ...) (int64, error) + func Create(ctx context.Context, db *gorm.DB, table interface{}) error + func Delete(ctx context.Context, db *gorm.DB, table interface{}, ...) error + func DeleteByID(ctx context.Context, db *gorm.DB, table interface{}, id interface{}) error + func Get(ctx context.Context, db *gorm.DB, table interface{}, ...) error + func GetByID(ctx context.Context, db *gorm.DB, table interface{}, id interface{}) error + func GetTableName(object interface{}) string + func Init(dns string, opts ...Option) (*gorm.DB, error) + func List(ctx context.Context, db *gorm.DB, tables interface{}, page *query.Page, ...) error + func NewCustomGormLogger(o *options) logger.Interface + func TableName(table interface{}) string + func Update(ctx context.Context, db *gorm.DB, table interface{}, column string, ...) error + func Updates(ctx context.Context, db *gorm.DB, table interface{}, update KV, ...) error + type KV = map[string]interface + type Model struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint64 + UpdatedAt time.Time + type Model2 struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint64 + UpdatedAt time.Time + type Option func(*options) + func WithConnMaxLifetime(t time.Duration) Option + func WithEnableForeignKey() Option + func WithEnableTrace() Option + func WithGormPlugin(plugins ...gorm.Plugin) Option + func WithLog() Option + func WithLogRequestIDKey(key string) Option + func WithLogging(l *zap.Logger, level ...logger.LogLevel) Option + func WithMaxIdleConns(size int) Option + func WithMaxOpenConns(size int) Option + func WithRWSeparation(slavesDsn []string, mastersDsn ...string) Option + func WithSlowThreshold(d time.Duration) Option