Skip to content

Commit 4269815

Browse files
authored
docs: updated readme, quick start, & syntax error with unicode (#656)
1 parent 1ed22e7 commit 4269815

File tree

3 files changed

+57
-58
lines changed

3 files changed

+57
-58
lines changed

README.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,50 +45,50 @@ Use the WASM powered playground to check your SQL locally in the browser!
4545
```shell
4646
❯ squawk example.sql
4747
warning[prefer-bigint-over-int]: Using 32-bit integer fields can result in hitting the max `int` limit.
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.
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.
5454
warning[prefer-identity]: Serial types make schema, dependency, and permission management difficult.
55-
--> example.sql:6:10
56-
|
57-
6 | "id" serial NOT NULL PRIMARY KEY,
58-
| ------
59-
|
60-
= help: Use Identity columns instead.
55+
╭▸ example.sql:6:10
56+
57+
6 "id" serial NOT NULL PRIMARY KEY,
58+
━━━━━━
59+
60+
help: Use an `IDENTITY` column instead.
6161
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-
--> example.sql:7:13
63-
|
64-
7 | "alpha" varchar(100) NOT NULL
65-
| ------------
66-
|
67-
= help: Use a `TEXT` field with a `CHECK` constraint.
62+
╭▸ example.sql:7:13
63+
64+
7 "alpha" varchar(100) NOT NULL
65+
━━━━━━━━━━━━
66+
67+
help: Use a `TEXT` field with a `CHECK` constraint.
6868
warning[require-concurrent-index-creation]: During normal index creation, table updates are blocked, but reads are still allowed.
69-
--> example.sql:10:1
70-
|
71-
10 | CREATE INDEX "field_name_idx" ON "table_name" ("field_name");
72-
| ------------------------------------------------------------
73-
|
74-
= help: Use `CONCURRENTLY` to avoid blocking writes.
69+
╭▸ example.sql:10:1
70+
71+
10 CREATE INDEX "field_name_idx" ON "table_name" ("field_name");
72+
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
73+
74+
help: Use `concurrently` to avoid blocking writes.
7575
warning[constraint-missing-not-valid]: By default new constraints require a table scan and block writes to the table while that scan occurs.
76-
--> example.sql:12:24
77-
|
78-
12 | ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
79-
| --------------------------------------------------------
80-
|
81-
= help: Use `NOT VALID` with a later `VALIDATE CONSTRAINT` call.
76+
╭▸ example.sql:12:24
77+
78+
12 ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
79+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
80+
81+
help: Use `NOT VALID` with a later `VALIDATE CONSTRAINT` call.
8282
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-
--> example.sql:12:28
84-
|
85-
12 | ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
86-
| ----------------------------------------------------
87-
|
88-
= help: Create an index `CONCURRENTLY` and create the constraint using the index.
83+
╭▸ example.sql:12:28
84+
85+
12 ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
86+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
87+
88+
help: Create an index `CONCURRENTLY` and create the constraint using the index.
8989

9090
Find detailed examples and solutions for each rule at https://squawkhq.com/docs/rules
91-
Found 7 issues in 1 file (checked 1 source file)
91+
Found 6 issues in 1 file (checked 1 source file)
9292
```
9393
9494
### `squawk --help`

docs/docs/quick_start.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,18 +58,19 @@ squawk example-migration.sql
5858
```
5959
❯ squawk example-migration.sql
6060
warning[constraint-missing-not-valid]: By default new constraints require a table scan and block writes to the table while that scan occurs.
61-
--> example-migration.sql:2:24
62-
|
63-
2 | ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
64-
| --------------------------------------------------------
65-
|
61+
╭▸ example-migration.sql:2:24
62+
63+
2 │ ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
64+
│ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65+
66+
╰ help: Use `NOT VALID` with a later `VALIDATE CONSTRAINT` call.
6667
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.
67-
--> example-migration.sql:2:28
68-
|
69-
2 | ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
70-
| ----------------------------------------------------
71-
|
72-
= help: Create an index CONCURRENTLY and create the constraint using the index.
68+
╭▸ example-migration.sql:2:28
69+
70+
2 ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
71+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
72+
73+
help: Create an index `CONCURRENTLY` and create the constraint using the index.
7374
7475
Find detailed examples and solutions for each rule at https://squawkhq.com/docs/rules
7576
Found 2 issues in 1 file (checked 1 source file)

docs/docs/syntax-error.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ trailing comma
1414
```sql
1515
select f(1,2,);
1616
-- error[syntax-error]: unexpected trailing comma
17-
-- --> stdin:1:13
18-
-- |
19-
-- 1 | select f(1,2,);
20-
-- | ^
21-
-- |
17+
-- ╭▸ stdin:1:13
18+
--
19+
-- 1 │ select f(1,2,);
20+
-- ╰╴ ━
2221
```
2322

2423
missing semicolon
@@ -27,11 +26,10 @@ missing semicolon
2726
select * from t
2827
select id from users where email = email;
2928
-- error[syntax-error]: expected SEMICOLON
30-
-- --> stdin:1:16
31-
-- |
32-
-- 1 | select * from t
33-
-- | ^
34-
-- |
29+
-- ╭▸ stdin:1:16
30+
--
31+
-- 1 │ select * from t
32+
-- ╰╴ ━
3533
```
3634

3735
## solutions

0 commit comments

Comments
 (0)