17 lines
423 B
Python
17 lines
423 B
Python
|
# -*- coding:utf-8 -*-
|
||
|
from importlib import import_module
|
||
|
|
||
|
|
||
|
def get_db_info(DBType):
|
||
|
db_dict = {}
|
||
|
moduleName = DBType + "Config"
|
||
|
# 合并处理
|
||
|
if DBType in ["MySQL5","MySQL8"]:
|
||
|
moduleName = "MySQLConfig"
|
||
|
elif DBType in ["PG","DM","Gbase8s"]:
|
||
|
moduleName = "PGConfig"
|
||
|
# 调用对应的模块
|
||
|
module = import_module(moduleName)
|
||
|
db_dict = module.db_config()
|
||
|
|
||
|
return db_dict
|