From 2b55865790f9a74189fe314eb60d5dee8e6488e6 Mon Sep 17 00:00:00 2001 From: junjun Date: Tue, 17 Mar 2026 15:09:36 +0800 Subject: [PATCH] feat: Support SSL for MySQL --- backend/apps/db/db.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/apps/db/db.py b/backend/apps/db/db.py index 24114a11..a2aab2a7 100644 --- a/backend/apps/db/db.py +++ b/backend/apps/db/db.py @@ -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