Some checks failed
Build docker and publish / linux (1.24.5) (push) Failing after 39s
refactor(service): 修改banner和guild删除逻辑为软删除 fix(service): 修复删除操作使用软删除而非物理删除 build: 添加SQLite测试仓库实现 docs: 新增奖励管理字段拆分和批量抽奖UI改造文档 ci: 更新CI忽略文件 style: 清理无用资源文件
23 lines
578 B
Go
23 lines
578 B
Go
package mysql
|
|
|
|
import (
|
|
"gorm.io/driver/sqlite"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
type sqliteRepo struct {
|
|
DbR *gorm.DB
|
|
DbW *gorm.DB
|
|
}
|
|
|
|
func (d *sqliteRepo) i() {}
|
|
func (d *sqliteRepo) GetDbR() *gorm.DB { return d.DbR }
|
|
func (d *sqliteRepo) GetDbW() *gorm.DB { return d.DbW }
|
|
func (d *sqliteRepo) DbRClose() error { return nil }
|
|
func (d *sqliteRepo) DbWClose() error { return nil }
|
|
|
|
func NewSQLiteRepoForTest() (Repo, error) {
|
|
db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{})
|
|
if err != nil { return nil, err }
|
|
return &sqliteRepo{DbR: db, DbW: db}, nil
|
|
} |