Spaces:
Running
Running
Commit ·
cf85b28
1
Parent(s): e68a95d
ok
Browse files
app/services/sql_validator_service.py
CHANGED
|
@@ -195,7 +195,9 @@ def _check_best_practices(statement: exp.Expression) -> list[str]:
|
|
| 195 |
"DELETE without a WHERE clause will remove every row from the table."
|
| 196 |
)
|
| 197 |
for join in statement.find_all(exp.Join):
|
| 198 |
-
|
|
|
|
|
|
|
| 199 |
warnings.append(
|
| 200 |
"NATURAL JOIN can produce unexpected column matches — "
|
| 201 |
"prefer explicit JOIN conditions."
|
|
|
|
| 195 |
"DELETE without a WHERE clause will remove every row from the table."
|
| 196 |
)
|
| 197 |
for join in statement.find_all(exp.Join):
|
| 198 |
+
kind = (join.args.get("kind") or "").upper()
|
| 199 |
+
method = (join.args.get("method") or "").upper()
|
| 200 |
+
if kind == "NATURAL" or method == "NATURAL":
|
| 201 |
warnings.append(
|
| 202 |
"NATURAL JOIN can produce unexpected column matches — "
|
| 203 |
"prefer explicit JOIN conditions."
|