Skip to content

Commit 01ab9f6

Browse files
authored
chore: add install docs (#259)
1 parent ed02300 commit 01ab9f6

File tree

3 files changed

+61
-6
lines changed

3 files changed

+61
-6
lines changed

biome.jsonc

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"vcs": {
44
"enabled": false,
55
"clientKind": "git",
6-
"useIgnoreFile": false
6+
"useIgnoreFile": true
77
},
88
"files": {
99
"ignoreUnknown": false,

docs/index.md

+59-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,22 @@ Our current focus is on refining and enhancing these core features while buildin
2525

2626
## Installation
2727

28-
> [!NOTE]
29-
> We will update this section once we have published the binaries.
28+
To install Postgres Tools, grab the executable for your platform from the [latest CLI release](https://github.com/supabase-community/postgres_lsp/releases/latest) on GitHub and give it execution permission.
29+
30+
```sh
31+
curl -L https://github.com/supabase-community/postgres_lsp/releases/download/<version>/postgrestools_aarch64-apple-darwin -o postgrestools
32+
chmod +x postgrestools
33+
```
34+
35+
Now you can use Postgres Tools by simply running `./postgrestools`.
36+
37+
If you are using Node, you can also install the CLI via NPM. Run the following commands in a directory containing a `package.json` file.
38+
39+
```sh
40+
pnpm add --save-dev --save-exact @postgrestools/postgrestools
41+
```
42+
43+
To use Postgres Tools in your favorite IDE, we recommend [installing an editor plugin](#install-an-editor-plugin).
3044

3145
## Configuration
3246

@@ -88,9 +102,50 @@ Make sure to check out the other options. We will provide guides for specific us
88102

89103
We recommend installing an editor plugin to get the most out of Postgres Language Tools.
90104

91-
> [!NOTE]
92-
> We will update this section once we have published the binaries.
105+
### VSCode
106+
107+
TODO
108+
109+
### Neovim
110+
111+
You will have to install `nvim-lspconfig`, and follow the [instructions](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#postgres_lsp).
112+
113+
114+
### Other
115+
116+
Postgres Tools has first-class LSP support. If your editor does implement LSP, then the integration of Postgres Tools should be seamless.
117+
118+
#### Use the LSP Proxy
119+
120+
Postgres Tools has a command called `lsp-proxy`. When executed, two processes will spawn:
121+
- a daemon that does execute the requested operations;
122+
- a server that functions as a proxy between the requests of the client - the editor - and the server - the daemon;
123+
If your editor is able to interact with a server and send [JSON-RPC](https://www.jsonrpc.org) requests, you only need to configure the editor to run that command.
124+
125+
#### Use the daemon with the binary
126+
Using the binary via CLI is very efficient, although you won’t be able to provide logs to your users. The CLI allows you to bootstrap a daemon and then use the CLI commands through the daemon itself.
127+
In order to do so, you first need to start a daemon process with the start command:
128+
129+
```sh
130+
postgrestools start
131+
```
132+
133+
Then, every command needs to add the `--use-server` options, e.g.:
134+
135+
```sh
136+
echo "select 1" | biome check --use-server --stdin-file-path=dummy.sql
137+
```
138+
139+
#### Daemon logs
140+
The daemon saves logs in your file system. Logs are stored in a folder called `pgt-logs`. The path of this folder changes based on your operative system:
141+
142+
- Linux: `~/.cache/pgt;`
143+
- Windows: `C:\Users\<UserName>\AppData\Local\supabase-community\pgt\cache`
144+
- macOS: `/Users/<UserName>/Library/Caches/dev.supabase-community.pgt`
145+
146+
For other operative systems, you can find the folder in the system’s temporary directory.
93147

148+
You can change the location of the `pgt-logs` folder via the `PGT_LOG_PATH` variable.
94149

95150
## CI Setup
96151

mkdocs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ theme:
1515
nav:
1616
- Introduction: index.md
1717
- Guides:
18-
- Linting Migrations: linting_migrations.md
18+
- Linting Migrations: checking_migrations.md
1919
- Troubleshooting: troubleshooting.md
2020
- Reference:
2121
- Rules: rules.md

0 commit comments

Comments
 (0)