feat(datasource): engine config

This commit is contained in:
junjun
2025-05-28 14:13:19 +08:00
parent a311ac66a0
commit 9b7c12f07e
+2 -1
View File
@@ -1,5 +1,6 @@
# Author: Junjun
# Date: 2025/5/19
import urllib.parse
from typing import List
from sqlalchemy import create_engine, text, MetaData, Table
@@ -16,7 +17,7 @@ def get_engine_config():
def get_engine_uri(conf: DatasourceConf):
return f"postgresql+psycopg2://{conf.username}:{conf.password}@{conf.host}:{conf.port}/{conf.database}"
return f"postgresql+psycopg2://{urllib.parse.quote(conf.username)}:{urllib.parse.quote(conf.password)}@{conf.host}:{conf.port}/{urllib.parse.quote(conf.database)}"
def get_engine_conn():