升级 install 能力, 支持sqlite
This commit is contained in:
@ -234,11 +234,11 @@ func (c *client) GetDatabaseClient(conf *Driver, logInstance *zap.Logger) (*gorm
|
||||
err error
|
||||
)
|
||||
|
||||
if conf.DBType == DriverTypeMysql {
|
||||
if conf.DBType == consts.DatabaseDriverMysql {
|
||||
if instance, err = gorm.Open(mysql.Open(c.buildConnectionDSN(conf)), &gorm.Config{}); nil != err {
|
||||
return nil, err
|
||||
}
|
||||
} else if conf.DBType == DriverTypeSqlite3 {
|
||||
} else if conf.DBType == consts.DatabaseDriverSqlite3 {
|
||||
if instance, err = gorm.Open(sqlite.Open(c.buildConnectionDSN(conf)), &gorm.Config{}); nil != err {
|
||||
return nil, err
|
||||
}
|
||||
@ -257,7 +257,7 @@ func (c *client) GetDatabaseClient(conf *Driver, logInstance *zap.Logger) (*gorm
|
||||
//
|
||||
// Date : 18:42 2022/6/11
|
||||
func (c *client) buildConnectionDSN(conf *Driver) string {
|
||||
if conf.DBType == DriverTypeSqlite3 {
|
||||
if conf.DBType == consts.DatabaseDriverSqlite3 {
|
||||
// 兼容sqlite3
|
||||
return conf.Host
|
||||
}
|
||||
|
Reference in New Issue
Block a user