refactor: 数据库meta使用注册方式,方便可插拔

This commit is contained in:
meilin.huang
2024-01-24 17:01:17 +08:00
parent bed95254d0
commit 7e9a381641
14 changed files with 55 additions and 99 deletions

View File

@@ -5,21 +5,12 @@ import (
"fmt"
"mayfly-go/internal/db/dbm/dbi"
"strings"
"sync"
go_ora "github.com/sijms/go-ora/v2"
)
var (
meta dbi.Meta
once sync.Once
)
func GetMeta() dbi.Meta {
once.Do(func() {
meta = new(OraMeta)
})
return meta
func init() {
dbi.Register(dbi.DbTypeOracle, new(OraMeta))
}
type OraMeta struct {