Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:support mongodb commit sql with comments #2403

Merged
merged 3 commits into from
Nov 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading