-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsql.json
More file actions
46 lines (46 loc) · 1.71 KB
/
sql.json
File metadata and controls
46 lines (46 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
"assistant": {
"rules": [
{
"regex": "(,)(\\s*\\W*)(from)",
"message": "Reminder: you don't need a comma on the last column",
"modifiers": "sig"
},
{
"regex": "(join)(\\s*\\w*)(\\s*\\w*\\s*)(and)",
"message": "An ON keyword must follow a join condition",
"modifiers": "sig"
},
{
"regex": "(with\\s)(\\w*\\s*)(as)",
"message": "Please refrain from using CTE's in production code. They are bad for redshift.",
"modifiers": "sig"
},
{
"regex": "(join\\s)(\\w*\\s*\\w*\\s*)(using)",
"message": "Do not use USING when joining tables, use ON.",
"modifiers": "sig"
},
{
"regex": "(limit\\s*\\d*\\s*)(order|group|where|having)",
"message": "Limit should be the last keyword in the query.",
"modifiers": "sig"
},
{
"regex": "commit;",
"message": "I can ensure you that Redshift does not have commitment issues, you do not need to write commit.",
"modifiers": "sig"
},
{
"regex": "(union\\s*)(select)",
"message": "I can't think a valid reason to use union. You should always be using union all. ",
"modifiers": "sig"
},
{
"regex": "char\\W1\\W",
"message": "You should be using a boolean if you are building a char with 1 space.",
"modifiers": "sig"
}
]
}
}