Skip to content

Commit dc4dd7b

Browse files
authored
v2: update readme with playground and adjust copy (#442)
1 parent 5936b6f commit dc4dd7b

File tree

4 files changed

+20
-23
lines changed

4 files changed

+20
-23
lines changed

README.md

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
# squawk [![npm](https://img.shields.io/npm/v/squawk-cli)](https://www.npmjs.com/package/squawk-cli)
22

3-
> linter for Postgres migrations
3+
> Linter for Postgres migrations & SQL
44
5-
[quick start](https://squawkhq.com/docs/) | [rules documentation](https://squawkhq.com/docs/rules) | [github action](https://github.com/sbdchd/squawk-action) | [diy github integration](https://squawkhq.com/docs/github_app)
5+
[Quick Start](https://squawkhq.com/docs/) | [Playground](https://play.squawkhq.com) | [Rules Documentation](https://squawkhq.com/docs/rules) | [GitHub Action](https://github.com/sbdchd/squawk-action) | [DIY GitHub Integration](https://squawkhq.com/docs/github_app)
66

77
## Why?
88

99
Prevent unexpected downtime caused by database migrations and encourage best
1010
practices around Postgres schemas and SQL.
1111

12-
Also it seemed like a nice project to spend more time with Rust.
13-
1412
## Install
1513

1614
```shell
@@ -179,11 +177,11 @@ repos:
179177
180178
Note the `files` parameter as it specifies the location of the files to be linted.
181179

182-
## prior art
180+
## Prior Art
183181

184182
- <https://github.com/erik/squabble>
185183

186-
### related tools
184+
### Related Tools
187185

188186
- <https://github.com/yandex/zero-downtime-migrations>
189187
- <https://github.com/tbicr/django-pg-zero-downtime-migrations>
@@ -195,7 +193,7 @@ Note the `files` parameter as it specifies the location of the files to be linte
195193
- <https://github.com/supabase-community/postgres-language-server>
196194
- <https://github.com/premium-minds/sonar-postgres-plugin>
197195

198-
## related blog posts / SE Posts / PG Docs
196+
## Related Blog Posts / SE Posts / PG Docs
199197

200198
- <https://www.braintreepayments.com/blog/safe-operations-for-high-volume-postgresql/>
201199
- <https://gocardless.com/blog/zero-downtime-postgres-migrations-the-hard-parts/>
@@ -207,7 +205,7 @@ Note the `files` parameter as it specifies the location of the files to be linte
207205
- <https://benchling.engineering/move-fast-and-migrate-things-how-we-automated-migrations-in-postgres-d60aba0fc3d4>
208206
- <https://medium.com/paypal-tech/postgresql-at-scale-database-schema-changes-without-downtime-20d3749ed680>
209207

210-
## dev
208+
## Dev
211209

212210
```shell
213211
cargo install
@@ -228,15 +226,15 @@ $ nix develop
228226
[nix-shell]$ ./s/fmt
229227
```
230228
231-
### adding a new rule
229+
### Adding a New Rule
232230
233231
When adding a new rule, the `s/new-rule` script will create stubs for your rule in Rust and in Documentation site.
234232
235233
```bash
236234
s/new-rule 'prefer big serial'
237235
```
238236

239-
### releasing a new version
237+
### Releasing a New Version
240238

241239
1. Update the `CHANGELOG.md`
242240

@@ -253,17 +251,12 @@ s/new-rule 'prefer big serial'
253251

254252
Use the text and version from the `CHANGELOG.md`
255253

256-
### algolia
254+
### Algolia
257255

258256
The squawkhq.com Algolia index can be found on [the crawler website](https://crawler.algolia.com/admin/crawlers/9bf0dffb-bc5a-4d46-9b8d-2f1197285213/overview). Algolia reindexes the site every day at 5:30 (UTC).
259257

260-
## how it works
261-
262-
squawk wraps calls to [libpg_query-sys](https://github.com/tdbgamer/libpg_query-sys) in a safe
263-
interface and parses the JSON into easier to work with structures.
264-
libpg_query-sys in turn uses [bindgen](https://rust-lang.github.io/rust-bindgen/) to bind to
265-
[libpg_query](https://github.com/lfittl/libpg_query), which itself wraps Postgres' SQL
266-
parser in a bit of C code that outputs the parsed AST into a JSON string.
258+
## How it Works
267259

268-
Squawk then runs the rule functions over the parsed AST, gathers and pretty
269-
prints the rule violations.
260+
Squawk uses its parser (based on rust-analyzer's parser) to create a CST. The
261+
linters then use an AST layered on top of the CST to navigate and record
262+
warnings, which are then pretty printed!

docs/src/pages/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ function Home() {
204204
<header className={clsx("hero hero--primary", styles.heroBanner)}>
205205
<div className="container">
206206
<h1 className="hero__title">Squawk</h1>
207-
<p className="hero__subtitle">A linter for Postgres migrations</p>
207+
<p className="hero__subtitle">
208+
A linter for Postgres migrations & SQL
209+
</p>
208210
<div className={styles.buttons}>
209211
<Link
210212
className={clsx(

playground/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# playground
22

3+
> <https://play.squawkhq.com>
4+
35
## dev
46

57
```shell

playground/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8-
"build": "wasm-pack build --target web ../crates/wasm --out-dir ../../playground/src/pkg && vite build",
9-
"deploy": "netlify deploy --prod",
8+
"build": "wasm-pack build --target web ../crates/squawk_wasm --out-dir ../../playground/src/pkg && vite build",
9+
"deploy": "netlify deploy --prod --dir dist",
1010
"lint": "eslint .",
1111
"preview": "vite preview"
1212
},

0 commit comments

Comments
 (0)