squawk-cli 2.26.0 → 2.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -45,50 +45,64 @@ Use the WASM powered playground to check your SQL locally in the browser!
|
|
|
45
45
|
```shell
|
|
46
46
|
❯ squawk example.sql
|
|
47
47
|
warning[prefer-bigint-over-int]: Using 32-bit integer fields can result in hitting the max `int` limit.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
6
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
╭▸ example.sql:6:10
|
|
49
|
+
│
|
|
50
|
+
6 │ "id" serial NOT NULL PRIMARY KEY,
|
|
51
|
+
│ ━━━━━━
|
|
52
|
+
│
|
|
53
|
+
├ help: Use 64-bit integer values instead to prevent hitting this limit.
|
|
54
|
+
╭╴
|
|
55
|
+
6 │ "id" bigserial NOT NULL PRIMARY KEY,
|
|
56
|
+
╰╴ +++
|
|
54
57
|
warning[prefer-identity]: Serial types make schema, dependency, and permission management difficult.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
6
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
╭▸ example.sql:6:10
|
|
59
|
+
│
|
|
60
|
+
6 │ "id" serial NOT NULL PRIMARY KEY,
|
|
61
|
+
│ ━━━━━━
|
|
62
|
+
│
|
|
63
|
+
├ help: Use an `IDENTITY` column instead.
|
|
64
|
+
╭╴
|
|
65
|
+
6 - "id" serial NOT NULL PRIMARY KEY,
|
|
66
|
+
6 + "id" integer generated by default as identity NOT NULL PRIMARY KEY,
|
|
67
|
+
╰╴
|
|
61
68
|
warning[prefer-text-field]: Changing the size of a `varchar` field requires an `ACCESS EXCLUSIVE` lock, that will prevent all reads and writes to the table.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
7
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
69
|
+
╭▸ example.sql:7:13
|
|
70
|
+
│
|
|
71
|
+
7 │ "alpha" varchar(100) NOT NULL
|
|
72
|
+
│ ━━━━━━━━━━━━
|
|
73
|
+
│
|
|
74
|
+
├ help: Use a `TEXT` field with a `CHECK` constraint.
|
|
75
|
+
╭╴
|
|
76
|
+
7 - "alpha" varchar(100) NOT NULL
|
|
77
|
+
7 + "alpha" text NOT NULL
|
|
78
|
+
╰╴
|
|
68
79
|
warning[require-concurrent-index-creation]: During normal index creation, table updates are blocked, but reads are still allowed.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
10
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
80
|
+
╭▸ example.sql:10:1
|
|
81
|
+
│
|
|
82
|
+
10 │ CREATE INDEX "field_name_idx" ON "table_name" ("field_name");
|
|
83
|
+
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
84
|
+
│
|
|
85
|
+
├ help: Use `concurrently` to avoid blocking writes.
|
|
86
|
+
╭╴
|
|
87
|
+
10 │ CREATE INDEX concurrently "field_name_idx" ON "table_name" ("field_name");
|
|
88
|
+
╰╴ ++++++++++++
|
|
75
89
|
warning[constraint-missing-not-valid]: By default new constraints require a table scan and block writes to the table while that scan occurs.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
12
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
90
|
+
╭▸ example.sql:12:24
|
|
91
|
+
│
|
|
92
|
+
12 │ ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
|
|
93
|
+
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
94
|
+
│
|
|
95
|
+
╰ help: Use `NOT VALID` with a later `VALIDATE CONSTRAINT` call.
|
|
82
96
|
warning[disallowed-unique-constraint]: Adding a `UNIQUE` constraint requires an `ACCESS EXCLUSIVE` lock which blocks reads and writes to the table while the index is built.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
12
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
97
|
+
╭▸ example.sql:12:28
|
|
98
|
+
│
|
|
99
|
+
12 │ ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
|
|
100
|
+
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
101
|
+
│
|
|
102
|
+
╰ help: Create an index `CONCURRENTLY` and create the constraint using the index.
|
|
89
103
|
|
|
90
104
|
Find detailed examples and solutions for each rule at https://squawkhq.com/docs/rules
|
|
91
|
-
Found
|
|
105
|
+
Found 6 issues in 1 file (checked 1 source file)
|
|
92
106
|
```
|
|
93
107
|
|
|
94
108
|
### `squawk --help`
|