mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-08 01:06:59 +08:00
perf: Embedded dynamic data source acquisition version
This commit is contained in:
+13
-2
@@ -155,8 +155,19 @@ def check_connection(trans: Trans, ds: CoreDatasource, is_raise: bool = False):
|
||||
return False
|
||||
|
||||
|
||||
def get_version(ds: CoreDatasource):
|
||||
conf = DatasourceConf(**json.loads(aes_decrypt(ds.configuration))) if ds.type != "excel" else get_engine_config()
|
||||
def get_version(ds: CoreDatasource | AssistantOutDsSchema):
|
||||
conf = None
|
||||
if isinstance(ds, CoreDatasource):
|
||||
conf = DatasourceConf(**json.loads(aes_decrypt(ds.configuration))) if ds.type != "excel" else get_engine_config()
|
||||
if isinstance(ds, AssistantOutDsSchema):
|
||||
conf = DatasourceConf()
|
||||
conf.host = ds.host
|
||||
conf.port = ds.port
|
||||
conf.username = ds.user
|
||||
conf.password = ds.password
|
||||
conf.database = ds.dataBase
|
||||
conf.dbSchema = ds.db_schema
|
||||
conf.timeout = 10
|
||||
db = DB.get_db(ds.type)
|
||||
sql = get_version_sql(ds, conf)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user