diff --git a/pydbapi/api/trino.py b/pydbapi/api/trino.py index 946bcdb..40e888c 100644 --- a/pydbapi/api/trino.py +++ b/pydbapi/api/trino.py @@ -2,7 +2,7 @@ # @Author: longfengpili # @Date: 2022-11-14 14:17:02 # @Last Modified by: longfengpili -# @Last Modified time: 2022-11-16 10:38:30 +# @Last Modified time: 2022-11-16 11:13:46 import re @@ -115,7 +115,7 @@ def get_conn(self): raise conn = connect(schema=self.database, user=self.user, password=self.password, host=self.host, port=self.port, catalog=self.catalog, - isolation_level=self.isolation_level # 如果使用事务模式,则不能(drop、select、create)混合使用 + # isolation_level=self.isolation_level # 如果使用事务模式,则不能(drop、select、create)混合使用 ) if not conn: self.get_conn() @@ -178,7 +178,9 @@ def execute(self, sql, count=None, ehandling='raise', verbose=0): try: self._execute_step(cur, sql, ehandling=ehandling) results = self.cur_results(cur, count) - except Exception: + except Exception as e: + sql = sql.replace('\n', '') # sql转换成一行 + mytrinologger.error(f"【Error】{e}, 【error Sql】: {sql}") conn.rollback() break diff --git a/pydbapi/db/base.py b/pydbapi/db/base.py index cc71eb7..ea0b2d7 100644 --- a/pydbapi/db/base.py +++ b/pydbapi/db/base.py @@ -1,7 +1,7 @@ # @Author: chunyang.xu # @Email: 398745129@qq.com # @Date: 2020-06-02 18:46:58 -# @Last Modified time: 2022-11-16 10:36:26 +# @Last Modified time: 2022-11-16 11:13:04 # @github: https://github.com/longfengpili # !/usr/bin/env python3 diff --git a/setup.py b/setup.py index da62494..1698617 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ # @Author: chunyang.xu # @Email: 398745129@qq.com # @Date: 2020-06-09 16:46:54 -# @Last Modified time: 2022-11-16 10:37:39 +# @Last Modified time: 2022-11-16 11:18:06 # @github: https://github.com/longfengpili # !/usr/bin/env python3 @@ -12,7 +12,7 @@ import shutil import setuptools -VERSION = '0.0.95' +VERSION = '0.0.96' PROJECT_NAME = 'pydbapi' with open('README.md', 'r', encoding='utf-8') as f: diff --git a/tests/trino/test_trino.py b/tests/trino/test_trino.py index 34f18c4..f27bdb1 100644 --- a/tests/trino/test_trino.py +++ b/tests/trino/test_trino.py @@ -2,7 +2,7 @@ # @Author: longfengpili # @Date: 2022-11-14 14:25:01 # @Last Modified by: longfengpili -# @Last Modified time: 2022-11-16 10:34:42 +# @Last Modified time: 2022-11-16 11:14:15 import sys