mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-12-05 15:30:25 +08:00
refactor: 数据库meta使用注册方式,方便可插拔
This commit is contained in:
@@ -9,22 +9,13 @@ import (
|
||||
"mayfly-go/pkg/utils/netx"
|
||||
"net"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
pq "gitee.com/liuzongyang/libpq"
|
||||
)
|
||||
|
||||
var (
|
||||
meta dbi.Meta
|
||||
once sync.Once
|
||||
)
|
||||
|
||||
func GetMeta() dbi.Meta {
|
||||
once.Do(func() {
|
||||
meta = new(PostgresMeta)
|
||||
})
|
||||
return meta
|
||||
func init() {
|
||||
dbi.Register(dbi.DbTypePostgres, new(PostgresMeta))
|
||||
}
|
||||
|
||||
type PostgresMeta struct {
|
||||
|
||||
Reference in New Issue
Block a user