feat: Support SSL for MySQL

This commit is contained in:
junjun
2026-03-17 15:12:49 +08:00
committed by Junjun
parent 5c136b46c5
commit 0315e27fd0
+3 -1
View File
@@ -154,7 +154,9 @@ def get_engine(ds: CoreDatasource, timeout: int = 0) -> Engine:
poolclass=NullPool)
elif equals_ignore_case(ds.type, 'oracle'):
engine = create_engine(get_uri(ds), poolclass=NullPool)
else: # mysql, ck
elif equals_ignore_case(ds.type, 'mysql'): # mysql
engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout, "ssl": {"require": True}}, poolclass=NullPool)
else: # ck
engine = create_engine(get_uri(ds), connect_args={"connect_timeout": conf.timeout}, poolclass=NullPool)
return engine