-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Prohibit the use of 'WHERE 1=1' in queries. - Not fix compatible, but can be done in next iterations
- Loading branch information
1 parent
8cf9dea
commit c346c9c
Showing
7 changed files
with
102 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# Ignore IDE files | ||
.vscode | ||
.idea | ||
/.sqlfluff | ||
**/.DS_Store | ||
|
||
# Ignore Python cache and prebuilt things | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[sqlfluff] | ||
dialect = snowflake | ||
|
||
[sqlfluff:layout:type:binary_operator] | ||
line_position = trailing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[sqlfluff:rules:EasyQL_L001] | ||
forbidden_columns = bar, baaz | ||
|
||
[sqlfluff:rules:EasyQL_L002] | ||
join_on_same_line = True | ||
[sqlfluff:layout:type:binary_operator] | ||
line_position = trailing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
rule: EasyQL_L003 | ||
|
||
no_where_used: | ||
pass_str: | | ||
SELECT | ||
a, | ||
sum(b) | ||
FROM tbl | ||
where_without_tautology: | ||
pass_str: | | ||
SELECT | ||
a, | ||
b, | ||
c | ||
FROM tbl | ||
WHERE | ||
a > b | ||
where_1_eq_1_v1: | ||
fail_str: | | ||
SELECT | ||
bar, | ||
baaz | ||
FROM tbl | ||
WHERE 1 = 1 | ||
where_1_eq_1_v1: | ||
fail_str: | | ||
SELECT | ||
bar, | ||
baaz | ||
FROM tbl | ||
WHERE 1=1 | ||
AND bar=1 | ||
where_1_eq_1_v2: | ||
fail_str: | | ||
SELECT | ||
bar, | ||
baaz | ||
FROM tbl | ||
WHERE | ||
1 = 1 AND bar = 1 | ||
where_1_eq_1_v3: | ||
fail_str: | | ||
SELECT | ||
bar, | ||
baaz | ||
FROM tbl | ||
WHERE | ||
1 = 1 |