From 32c5acc6f25a6477f20cf58822a98083b7ac96fa Mon Sep 17 00:00:00 2001 From: Steve Dignam Date: Mon, 15 Sep 2025 23:40:47 -0400 Subject: [PATCH] docs: updated readme, quick start, & syntax error with unicode --- README.md | 74 +++++++++++++++++++-------------------- docs/docs/quick_start.md | 23 ++++++------ docs/docs/syntax-error.md | 18 +++++----- 3 files changed, 57 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index b88dacef..e8ce107b 100644 --- a/README.md +++ b/README.md @@ -45,50 +45,50 @@ Use the WASM powered playground to check your SQL locally in the browser! ```shell ❯ squawk example.sql warning[prefer-bigint-over-int]: Using 32-bit integer fields can result in hitting the max `int` limit. - --> example.sql:6:10 - | -6 | "id" serial NOT NULL PRIMARY KEY, - | ------ - | - = help: Use 64-bit integer values instead to prevent hitting this limit. + ╭▸ example.sql:6:10 + │ +6 │ "id" serial NOT NULL PRIMARY KEY, + │ ━━━━━━ + │ + ╰ help: Use 64-bit integer values instead to prevent hitting this limit. warning[prefer-identity]: Serial types make schema, dependency, and permission management difficult. - --> example.sql:6:10 - | -6 | "id" serial NOT NULL PRIMARY KEY, - | ------ - | - = help: Use Identity columns instead. + ╭▸ example.sql:6:10 + │ +6 │ "id" serial NOT NULL PRIMARY KEY, + │ ━━━━━━ + │ + ╰ help: Use an `IDENTITY` column instead. 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. - --> example.sql:7:13 - | -7 | "alpha" varchar(100) NOT NULL - | ------------ - | - = help: Use a `TEXT` field with a `CHECK` constraint. + ╭▸ example.sql:7:13 + │ +7 │ "alpha" varchar(100) NOT NULL + │ ━━━━━━━━━━━━ + │ + ╰ help: Use a `TEXT` field with a `CHECK` constraint. warning[require-concurrent-index-creation]: During normal index creation, table updates are blocked, but reads are still allowed. - --> example.sql:10:1 - | -10 | CREATE INDEX "field_name_idx" ON "table_name" ("field_name"); - | ------------------------------------------------------------ - | - = help: Use `CONCURRENTLY` to avoid blocking writes. + ╭▸ example.sql:10:1 + │ +10 │ CREATE INDEX "field_name_idx" ON "table_name" ("field_name"); + │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + │ + ╰ help: Use `concurrently` to avoid blocking writes. warning[constraint-missing-not-valid]: By default new constraints require a table scan and block writes to the table while that scan occurs. - --> example.sql:12:24 - | -12 | ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name); - | -------------------------------------------------------- - | - = help: Use `NOT VALID` with a later `VALIDATE CONSTRAINT` call. + ╭▸ example.sql:12:24 + │ +12 │ ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name); + │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + │ + ╰ help: Use `NOT VALID` with a later `VALIDATE CONSTRAINT` call. 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. - --> example.sql:12:28 - | -12 | ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name); - | ---------------------------------------------------- - | - = help: Create an index `CONCURRENTLY` and create the constraint using the index. + ╭▸ example.sql:12:28 + │ +12 │ ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name); + │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + │ + ╰ help: Create an index `CONCURRENTLY` and create the constraint using the index. Find detailed examples and solutions for each rule at https://squawkhq.com/docs/rules -Found 7 issues in 1 file (checked 1 source file) +Found 6 issues in 1 file (checked 1 source file) ``` ### `squawk --help` diff --git a/docs/docs/quick_start.md b/docs/docs/quick_start.md index 6570e145..f6d0396f 100644 --- a/docs/docs/quick_start.md +++ b/docs/docs/quick_start.md @@ -58,18 +58,19 @@ squawk example-migration.sql ``` ❯ squawk example-migration.sql warning[constraint-missing-not-valid]: By default new constraints require a table scan and block writes to the table while that scan occurs. - --> example-migration.sql:2:24 - | -2 | ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name); - | -------------------------------------------------------- - | + ╭▸ example-migration.sql:2:24 + │ +2 │ ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name); + │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + │ + ╰ help: Use `NOT VALID` with a later `VALIDATE CONSTRAINT` call. 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. - --> example-migration.sql:2:28 - | -2 | ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name); - | ---------------------------------------------------- - | - = help: Create an index CONCURRENTLY and create the constraint using the index. + ╭▸ example-migration.sql:2:28 + │ +2 │ ALTER TABLE table_name ADD CONSTRAINT field_name_constraint UNIQUE (field_name); + │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + │ + ╰ help: Create an index `CONCURRENTLY` and create the constraint using the index. Find detailed examples and solutions for each rule at https://squawkhq.com/docs/rules Found 2 issues in 1 file (checked 1 source file) diff --git a/docs/docs/syntax-error.md b/docs/docs/syntax-error.md index 4e28da83..5c0270c7 100644 --- a/docs/docs/syntax-error.md +++ b/docs/docs/syntax-error.md @@ -14,11 +14,10 @@ trailing comma ```sql select f(1,2,); -- error[syntax-error]: unexpected trailing comma --- --> stdin:1:13 --- | --- 1 | select f(1,2,); --- | ^ --- | +-- ╭▸ stdin:1:13 +-- │ +-- 1 │ select f(1,2,); +-- ╰╴ ━ ``` missing semicolon @@ -27,11 +26,10 @@ missing semicolon select * from t select id from users where email = email; -- error[syntax-error]: expected SEMICOLON --- --> stdin:1:16 --- | --- 1 | select * from t --- | ^ --- | +-- ╭▸ stdin:1:16 +-- │ +-- 1 │ select * from t +-- ╰╴ ━ ``` ## solutions