From 48201a87158ded349119799c6186415c0b5f80a3 Mon Sep 17 00:00:00 2001 From: cuiweizhi <560397@gree.com.cn> Date: Sun, 12 Nov 2023 11:53:04 +0800 Subject: [PATCH] Update project --- application/config/config.yaml | 8 ++++++++ application/libs/helper/mysql.py | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/application/config/config.yaml b/application/config/config.yaml index 6e089b4..09a9fb7 100644 --- a/application/config/config.yaml +++ b/application/config/config.yaml @@ -36,3 +36,11 @@ Scheduler: Start: 2023-11-12 10:04:00 End: 2099-11-11 16:00:00 Timezone: Asia/Shanghai + +ExtraDB: + Host: localhost + Port: 3306 + User: root + Password: localhost123 + DB: elp + Sql: select * from users; diff --git a/application/libs/helper/mysql.py b/application/libs/helper/mysql.py index fc0e392..00d731b 100644 --- a/application/libs/helper/mysql.py +++ b/application/libs/helper/mysql.py @@ -40,14 +40,14 @@ class MySQLHelper: if self.conn: self.conn.close() if exc_type: - print(f"Error occurred: {exc_val}") + print(f'Error occurred: {exc_val}') def execute(self, sql: str) -> Optional[tuple]: """ Execute the SQL statement and retrieve the results """ if not self.conn: - print("No connection available.") + print('No connection available.') return None try: @@ -58,5 +58,5 @@ class MySQLHelper: return result except Exception as e: - print(f"Error executing SQL: {e}") + print(f'Error executing SQL: {e}') return None -- GitLab