From ee279cf062fb964b770f0b14aa40da5dfb3505d6 Mon Sep 17 00:00:00 2001 From: moocss Date: Fri, 23 Aug 2024 08:49:38 +0800 Subject: [PATCH] fix: db --- db/gorm/wrapper.go | 2 ++ db/redis/wrapper.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/db/gorm/wrapper.go b/db/gorm/wrapper.go index da688d3..7fdfb05 100644 --- a/db/gorm/wrapper.go +++ b/db/gorm/wrapper.go @@ -29,6 +29,8 @@ type Transaction interface { Execute(ctx context.Context, fn func(ctx context.Context) error) error } +type DB = gorm.DB + type Helper struct { lock *sync.RWMutex group *singleflight.Group diff --git a/db/redis/wrapper.go b/db/redis/wrapper.go index d3aa0e8..c83ce94 100644 --- a/db/redis/wrapper.go +++ b/db/redis/wrapper.go @@ -11,6 +11,10 @@ import ( var _ Database = (*Helper)(nil) type ( + // Cmdable is an alias of redis.Cmdable. + Cmdable = redis.Cmdable + // BoolCmd is an alias of redis.BoolCmd. + BoolCmd = redis.BoolCmd // IntCmd is an alias of redis.IntCmd. IntCmd = redis.IntCmd // FloatCmd is an alias of redis.FloatCmd.