Skip to content

Commit 2b55865

Browse files
committed
feat: Support SSL for MySQL
1 parent 5c136b4 commit 2b55865

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/apps/db/db.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,9 @@ def get_engine(ds: CoreDatasource, timeout: int = 0) -> Engine:
154154
poolclass=NullPool)
155155
elif equals_ignore_case(ds.type, 'oracle'):
156156
engine = create_engine(get_uri(ds), poolclass=NullPool)
157-
else: # mysql, ck
157+
elif equals_ignore_case(ds.type, 'mysql'): # mysql
158+
engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout, "ssl": {"require": True}}, poolclass=NullPool)
159+
else: # ck
158160
engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout}, poolclass=NullPool)
159161
return engine
160162

0 commit comments

Comments
 (0)