From 7b2d88f908fed3f76c24b8e62364f28454c671f0 Mon Sep 17 00:00:00 2001 From: longfengpili <398745129@qq.com> Date: Fri, 1 Mar 2024 11:44:17 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BC=98=E5=8C=96]execute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pydbapi/api/trino.py | 2 +- pydbapi/db/base.py | 7 ++++--- setup.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pydbapi/api/trino.py b/pydbapi/api/trino.py index 31b1457..c90fcd1 100644 --- a/pydbapi/api/trino.py +++ b/pydbapi/api/trino.py @@ -2,7 +2,7 @@ # @Author: longfengpili # @Date: 2023-06-02 15:27:41 # @Last Modified by: longfengpili -# @Last Modified time: 2024-03-01 10:05:18 +# @Last Modified time: 2024-03-01 11:34:01 # @github: https://github.com/longfengpili diff --git a/pydbapi/db/base.py b/pydbapi/db/base.py index 8a9b219..313187d 100644 --- a/pydbapi/db/base.py +++ b/pydbapi/db/base.py @@ -2,7 +2,7 @@ # @Author: longfengpili # @Date: 2023-06-02 15:27:41 # @Last Modified by: longfengpili -# @Last Modified time: 2024-03-01 10:16:08 +# @Last Modified time: 2024-03-01 11:37:15 # @github: https://github.com/longfengpili @@ -137,8 +137,9 @@ def execute(self, sql, count=None, ehandling='raise', verbose=0): except Exception as e: dblogger.error(e) if ehandling == 'raise': - conn.rollback() - raise e + if self.dbtype not in ('trino',): + conn.rollback() + raise finally: if self.dbtype not in ('trino',): cur.close() diff --git a/setup.py b/setup.py index 2841059..7541b51 100644 --- a/setup.py +++ b/setup.py @@ -2,13 +2,13 @@ # @Author: longfengpili # @Date: 2023-06-02 15:27:41 # @Last Modified by: longfengpili -# @Last Modified time: 2024-03-01 10:17:37 +# @Last Modified time: 2024-03-01 11:43:49 # @github: https://github.com/longfengpili import setuptools -VERSION = '0.0.119' +VERSION = '0.0.120' PROJECT_NAME = 'pydbapi' with open('README.md', 'r', encoding='utf-8') as f: