Skip to content

Commit

Permalink
feat:support mongodb commit sql with comments (hhyo#2403)
Browse files Browse the repository at this point in the history
* feat:support mongodb commit sql with comments

* feat:support mongodb commit sql with comments

* fix:black code

---------

Co-authored-by: linhui <linhui@hellotalk.com>
  • Loading branch information
2 people authored and finovy committed Dec 1, 2023
1 parent b1fd2eb commit 172a5cf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sql/engines/mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,8 @@ def execute_check(self, db_name=None, sql=""):
check_result = ReviewSet(full_sql=sql)

sql = sql.strip()
# sql 检查过滤注释语句
sql = re.sub(r"^\s*//.*$", "", sql, flags=re.MULTILINE)
if sql.find(";") < 0:
raise Exception("提交的语句请以分号结尾")
# 以;切分语句,逐句执行
Expand Down

0 comments on commit 172a5cf

Please sign in to comment.