feat: 実行SQLのタイムゾーンをJSTに変更するメソッドを追加

This commit is contained in:
高木要 2023-08-01 14:11:49 +09:00
parent f039780c46
commit cb47f7d186
2 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,7 @@ def exec():
db = Database.get_instance()
try:
db.connect()
db.to_jst()
logger.debug('処理開始')
# 卸販売実績テーブル(洗替後)作成
_call_sales_lau_upsert(db)

View File

@ -180,6 +180,9 @@ class Database:
self.__connection.close()
self.__connection = None
def to_jst(self):
self.execute('SET time_zone = "+9:00"')
def __execute_with_transaction(self, query: str, parameters: dict):
# トランザクションを開始してクエリを実行する
with self.__connection.begin():