Skip to content

Commit

Permalink
mysql和pgsql支持with查询
Browse files Browse the repository at this point in the history
  • Loading branch information
woshiyanghai committed Jan 17, 2025
1 parent 69e29b1 commit 82c4042
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion sql/engines/mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ def query_check(self, db_name=None, sql=""):
except IndexError:
result["bad_query"] = True
result["msg"] = "没有有效的SQL语句"
if re.match(r"^select|^show|^explain", sql, re.I) is None:
if re.match(r"^select|^show|^explain|^with", sql, re.I) is None:
result["bad_query"] = True
result["msg"] = "不支持的查询语法类型!"
if "*" in sql:
Expand Down
2 changes: 1 addition & 1 deletion sql/engines/pgsql.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def query_check(self, db_name=None, sql=""):
except IndexError:
result["bad_query"] = True
result["msg"] = "没有有效的SQL语句"
if re.match(r"^select|^explain", sql, re.I) is None:
if re.match(r"^select|^explain|^with", sql, re.I) is None:
result["bad_query"] = True
result["msg"] = "不支持的查询语法类型!"
if "*" in sql:
Expand Down

0 comments on commit 82c4042

Please # to comment.