Skip to content

Commit

Permalink
[优化]execute
Browse files Browse the repository at this point in the history
  • Loading branch information
longfengpili committed Mar 1, 2024
1 parent 429724c commit 7b2d88f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pydbapi/api/trino.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
7 changes: 4 additions & 3 deletions pydbapi/db/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 7b2d88f

Please sign in to comment.