Skip to content

Commit 540223a

Browse files
authored
chore(docs): new binary name (#565)
1 parent 8322a41 commit 540223a

File tree

12 files changed

+85
-81
lines changed

12 files changed

+85
-81
lines changed

.github/workflows/pull_request.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,9 @@ jobs:
112112
sleep 1
113113
done
114114
115-
- name: Install tree-sitter-cli
116-
run: cargo install tree-sitter-cli
115+
- uses: tree-sitter/setup-action@v2
116+
with:
117+
install-lib: false
117118

118119
- name: Setup sqlx-cli
119120
run: cargo install sqlx-cli
@@ -170,8 +171,9 @@ jobs:
170171
- name: Setup Postgres
171172
uses: ./.github/actions/setup-postgres
172173

173-
- name: Install tree-sitter-cli
174-
run: cargo install tree-sitter-cli
174+
- uses: tree-sitter/setup-action@v2
175+
with:
176+
install-lib: false
175177

176178
- name: Run tests
177179
run: cargo test --workspace
@@ -201,8 +203,9 @@ jobs:
201203
uses: moonrepo/setup-rust@v1
202204
with:
203205
cache-base: main
204-
- name: Install tree-sitter-cli
205-
run: cargo install tree-sitter-cli
206+
- uses: tree-sitter/setup-action@v2
207+
with:
208+
install-lib: false
206209
- name: Build main binary
207210
run: cargo build -p pgt_cli --release
208211
- name: Setup Bun
@@ -244,8 +247,9 @@ jobs:
244247
cache-base: main
245248
env:
246249
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
247-
- name: Install tree-sitter-cli
248-
run: cargo install tree-sitter-cli
250+
- uses: tree-sitter/setup-action@v2
251+
with:
252+
install-lib: false
249253
- name: Ensure RustFMT on nightly toolchain
250254
run: rustup component add rustfmt --toolchain nightly
251255
- name: echo toolchain

docs/codegen/src/cli_doc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn generate_cli_doc(docs_dir: &Path) -> anyhow::Result<()> {
1111
let new_content = utils::replace_section(
1212
&content,
1313
"CLI_REF",
14-
&pgt_command().render_markdown("postgrestools"),
14+
&pgt_command().render_markdown("postgres-language-server"),
1515
);
1616

1717
fs::write(file_path, &new_content)?;

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ You can control the files/folders to process using different strategies, either
5454
The first way to control which files and folders are processed is to list them in the CLI. In the following command, we only check `file1.sql` and all the files in the `src` folder, because folders are recursively traversed.
5555

5656
```shell
57-
postgrestools check file1.js src/
57+
postgres-language-server check file1.js src/
5858
```
5959

6060
### Control files via configuration

docs/features/linting.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ The linter can also be used via the CLI for CI integration:
5454

5555
```bash
5656
# Lint specific files
57-
postgrestools check migrations/
57+
postgres-language-server check migrations/
5858

5959
# With specific rules
60-
postgrestools check migrations/ --only safety/banDropColumn
60+
postgres-language-server check migrations/ --only safety/banDropColumn
6161

6262
# Skip certain rules
63-
postgrestools check migrations/ --skip safety/banDropTable
63+
postgres-language-server check migrations/ --skip safety/banDropTable
6464
```
6565

6666
See the [CLI Reference](../reference/cli.md) for more options, and check the guide on [linting migrations]('../guides/checking_migrations.md').

docs/getting_started.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The Postgres Language Server can be installed as a development dependency of you
77
We recommend creating a `postgres-language-server.jsonc` configuration file for each project. This eliminates repetitive CLI options and ensures that consistent configuration in your editor. Some options are only available from a configuration file. This step is optional though: if you are happy with the defaults, you don’t need a configuration file. To create the `postgres-language-server.jsonc` file, run the `init` command in the root folder of your project:
88

99
```sh
10-
postgrestools init
10+
postgres-language-server init
1111
```
1212

1313
You’ll now have a `postgres-language-server.jsonc` file in your directory:
@@ -45,9 +45,9 @@ You’ll now have a `postgres-language-server.jsonc` file in your directory:
4545

4646
[//]: # "END DEFAULT_CONFIGURATION"
4747

48-
Make sure to edit the database connection settings to connect to your local development database. To see all options, run `postgrestools --help`.
48+
Make sure to edit the database connection settings to connect to your local development database. To see all options, run `postgres-language-server --help`.
4949

50-
You can use your current `postgrestools` version instead of "latest" in the `$schema` URL, e.g. `https://pgtools.dev/0.8.1/schema.json`.
50+
You can use your current `postgres-language-server` version instead of "latest" in the `$schema` URL, e.g. `https://pg-language-server.com/0.8.1/schema.json`.
5151

5252
## Usage
5353

@@ -59,13 +59,13 @@ The CLI exposes a `check` command that will run all checks on the given files or
5959

6060
```sh
6161
# check a specific file
62-
postgrestools check myfile.sql
62+
postgres-language-server check myfile.sql
6363

6464
# check a directory
65-
postgrestools check supabase/migrations
65+
postgres-language-server check supabase/migrations
6666
```
6767

68-
Run `postgrestools --help` for all options. The CLI options take precedence over what is loaded from `postgres-language-server.jsonc`.
68+
Run `postgres-language-server --help` for all options. The CLI options take precedence over what is loaded from `postgres-language-server.jsonc`.
6969

7070
### Editor Integrations
7171

@@ -78,7 +78,7 @@ The Postgres Language Server is available as an extension in your favorite edito
7878

7979
### Continuous Integration
8080

81-
Run `postgrestools check` in your CI pipeline to lint your schema changes and enforce code quality across your team. We provide a [GitHub Action](https://github.com/supabase-community/postgrestools-cli-action) to setup the Postgres Language Server in your runner.
81+
Run `postgres-language-server check` in your CI pipeline to lint your schema changes and enforce code quality across your team. We provide a [GitHub Action](https://github.com/supabase-community/postgrestools-cli-action) to setup the Postgres Language Server in your runner.
8282

8383
See the [Continuous Integration](/guides/continuous_integration) guide for an example.
8484

docs/guides/checking_migrations.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Postgres Language Tools comes with a `check` command that can be integrated into
55
To run it, simply point at your migrations directory.
66

77
```sh
8-
postgrestools check supabase/migrations
8+
postgres-language-server check supabase/migrations
99
```
1010

1111
When you are setting it up in an existing project, you might want to ignore all migrations that are already applied. To do so, add `migrationsDir` and `after` to your `postgres-language-server.jsonc` file
@@ -23,7 +23,7 @@ When you are setting it up in an existing project, you might want to ignore all
2323
Alternatively, pass them directly.
2424

2525
```
26-
postgrestools check supabase/migrations --migrations-dir="supabase/migrations" --after=1740868021
26+
postgres-language-server check supabase/migrations --migrations-dir="supabase/migrations" --after=1740868021
2727
```
2828

2929
This will only check migrations after the specified timestamp.

docs/guides/configure_database.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ Configure database connection details in your `postgres-language-server.jsonc` f
4545
The language server primarily needs read access to your database schema. Consider creating a dedicated user with limited permissions:
4646

4747
```sql
48-
CREATE USER postgrestools_lsp WITH PASSWORD 'secure_password';
49-
GRANT CONNECT ON DATABASE your_database TO postgrestools_lsp;
50-
GRANT USAGE ON SCHEMA public TO postgrestools_lsp;
51-
GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgrestools_lsp;
52-
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO postgrestools_lsp;
53-
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO postgrestools_lsp;
48+
CREATE USER postgres_language_server WITH PASSWORD 'secure_password';
49+
GRANT CONNECT ON DATABASE your_database TO postgres_language_server;
50+
GRANT USAGE ON SCHEMA public TO postgres_language_server;
51+
GRANT SELECT ON ALL TABLES IN SCHEMA public TO postgres_language_server;
52+
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO postgres_language_server;
53+
GRANT EXECUTE ON ALL FUNCTIONS IN SCHEMA public TO postgres_language_server;
5454
```
5555

5656
### Statement Execution Control
@@ -79,7 +79,7 @@ If you prefer to work without a database connection, you can disable all databas
7979
Or use the command line flag:
8080

8181
```bash
82-
postgrestools check sql/ --disable-db
82+
postgres-language-server check sql/ --disable-db
8383
```
8484

8585
When disabled, you'll still get:

docs/guides/continuous_integration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Running the Postgres Language Server in a CI environment can boost your teams co
44

55
### GitHub Actions
66

7-
We provide a first-party [GitHub Action](https://github.com/supabase-community/postgrestools-cli-action) to setup the CLI in your runner. Heres what a simple workflow might look like:
7+
We provide a first-party [GitHub Action](https://github.com/supabase-community/postgrestools-cli-action) to setup the CLI in your runner. Here's what a simple workflow might look like:
88

99
```yaml
1010
jobs:
@@ -15,7 +15,7 @@ jobs:
1515
- uses: supabase-community/pglt-cli-action@main
1616
with:
1717
version: latest
18-
- run: postgrestools check --skip-db sql/
18+
- run: postgres-language-server check --skip-db sql/
1919
```
2020
2121
You likely want to setup Postgres to enable more advanced checks:
@@ -38,7 +38,7 @@ jobs:
3838
- uses: supabase-community/pglt-cli-action@main
3939
with:
4040
version: latest
41-
- run: postgrestools check sql/
41+
- run: postgres-language-server check sql/
4242
```
4343
4444
A common use-case is to check your migration files. Check out [the dedicated guide](./checking_migrations.md) for details.

docs/guides/ide_setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ Using the binary via CLI is very efficient, although you will not be able to pro
4040
If order to do so, you first need to start a daemon process with the start command:
4141

4242
```shell
43-
postgrestools start
43+
postgres-language-server start
4444
```
4545

4646
Then, every command needs to add the `--use-server` options, e.g.:
4747

4848
```shell
49-
postgrestools check --use-server --stdin-file-path=dummy.sql
49+
postgres-language-server check --use-server --stdin-file-path=dummy.sql
5050
```
5151

5252

docs/guides/vcs_integration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ First, you have to update your configuration file with the default branch via th
5050
Add the `--changed` option to your command to process only those files that your VCS acknowledged as “changed”. The language server will determine the changed files from the branch `main` and your current revision:
5151

5252
```shell
53-
postgrestools check --changed
53+
postgres-language-server check --changed
5454
```
5555

5656
Alternatively, you can use the option `--since` to specify an arbitrary branch. This option takes precedence over the option `vcs.defaultBranch`. For example, you might want to check your changes against the `next` branch:
5757

5858
```shell
59-
postgrestools check --changed --since=next
59+
postgres-language-server check --changed --since=next
6060
```
6161

6262
## Process only staged files
6363

6464
Before committing your changes, you may want to check the files that have been added to the index, also known as staged files. Add the `--staged` option to process only those files:
6565

6666
```shell
67-
postgrestools check --staged
67+
postgres-language-server check --staged
6868
```
6969

0 commit comments

Comments
 (0)