Skip to content

Commit 4abf176

Browse files
committed
Merge branch 'main' of https://github.com/dataease/SQLBot
2 parents 521706c + 26c68fb commit 4abf176

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

backend/apps/datasource/models/datasource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def to_dict(self):
9999
class TableSchema:
100100
def __init__(self, attr1, attr2):
101101
self.tableName = attr1
102-
self.tableComment = attr2
102+
self.tableComment = attr2 if isinstance(attr2, str) else attr2.decode("utf-8")
103103

104104
tableName: str
105105
tableComment: str
@@ -109,7 +109,7 @@ class ColumnSchema:
109109
def __init__(self, attr1, attr2, attr3):
110110
self.fieldName = attr1
111111
self.fieldType = attr2
112-
self.fieldComment = attr3
112+
self.fieldComment = attr3 if isinstance(attr3, str) else attr3.decode("utf-8")
113113

114114
fieldName: str
115115
fieldType: str

backend/apps/db/db.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,15 @@ def get_engine(ds: CoreDatasource) -> Engine:
6161
connect_args={"options": f"-c search_path={conf.dbSchema}",
6262
"connect_timeout": conf.timeout},
6363
pool_timeout=conf.timeout, pool_size=20, max_overflow=10)
64-
elif ds.type == 'oracle' or ds.type == 'sqlServer':
64+
elif ds.type == 'sqlServer':
6565
engine = create_engine(get_uri(ds), pool_timeout=conf.timeout,
6666
pool_size=20,
6767
max_overflow=10)
68+
elif ds.type == 'oracle':
69+
engine = create_engine(get_uri(ds),
70+
pool_timeout=conf.timeout,
71+
pool_size=20,
72+
max_overflow=10)
6873
else:
6974
engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout}, pool_timeout=conf.timeout,
7075
pool_size=20,

0 commit comments

Comments
 (0)