Skip to content

Commit

Permalink
[修复]spl_sqls
Browse files Browse the repository at this point in the history
  • Loading branch information
longfengpili committed Oct 25, 2023
1 parent 467af3e commit 7df2c3e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pydbapi/sql/parse.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: 2023-07-27 15:35:15
# @Last Modified time: 2023-10-25 10:16:33
# @github: https://github.com/longfengpili


Expand Down Expand Up @@ -39,6 +39,7 @@ def sql(self):

@staticmethod
def split_sqls(sql):
sql = sql.strip()
sql = sql if sql.endswith(';') else sql + ';'
sql_r1 = re.sub('; *\n', ';\n', sql) # 处理多余的;
sql_r2 = re.sub(';$', ';\n', sql_r1) # 末尾增加'\n'
Expand Down

0 comments on commit 7df2c3e

Please sign in to comment.