From f185d551ccfe3027272ed517ad3f56d6681a3855 Mon Sep 17 00:00:00 2001 From: psteinroe Date: Tue, 25 Mar 2025 14:56:17 +0100 Subject: [PATCH 1/7] chore: add install docs --- biome.jsonc | 2 +- docs/index.md | 61 +++++++++++++++++++++++++++++++++++++++++++++++---- mkdocs.yml | 2 +- 3 files changed, 59 insertions(+), 6 deletions(-) diff --git a/biome.jsonc b/biome.jsonc index 479e0e9f..36b60d9b 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -3,7 +3,7 @@ "vcs": { "enabled": false, "clientKind": "git", - "useIgnoreFile": false + "useIgnoreFile": true }, "files": { "ignoreUnknown": false, diff --git a/docs/index.md b/docs/index.md index 9d186437..ca9b4cd0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -25,8 +25,22 @@ Our current focus is on refining and enhancing these core features while buildin ## Installation -> [!NOTE] -> We will update this section once we have published the binaries. +To install Postgres Tools, grab the executable for your platform from the [latest CLI release](https://github.com/supabase-community/postgres_lsp/releases) on GitHub and give it execution permission. + +```sh +curl -L https://github.com/supabase-community/postgres_lsp/releases/download//postgrestools_aarch64-apple-darwin -o postgrestools +chmod +x postgrestools +``` + +Now you can use Postgres Tools by simply running `./postgrestools`. + +If you are using Node anyways, you can also install the CLI via NPM. Run the following commands in a directory containing a `package.json` file. + +```sh +pnpm add --save-dev --save-exact @postgrestools/postgrestools +``` + +To use Postgres Tools in your favorite IDE, we recommend [installing an editor plugin](#install-an-editor-plugin). ## Configuration @@ -88,9 +102,48 @@ Make sure to check out the other options. We will provide guides for specific us We recommend installing an editor plugin to get the most out of Postgres Language Tools. -> [!NOTE] -> We will update this section once we have published the binaries. +### VSCode + +TODO + +### Neovim + +You will have to install `nvim-lspconfig`, and follow the [instructions](https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#postgres_lsp). + + +### Other + +Postgres Tools has LSP first-class support. If your editor does implement LSP, then the integration of Postgres Tools should be seamless. + +#### Use the LSP Proxy + +Postgres Tools has a command called `lsp-proxy`. When executed, two processes will spawn: +- a daemon that does execute the requested operations; +- a server that functions as a proxy between the requests of the client - the editor - and the server - the daemon; +If your editor is able to interact with a server and send [JSON-RPC](https://www.jsonrpc.org) request, you only need to configure the editor run that command. + +#### Use the daemon with the binary +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. +If order to do so, you first need to start a daemon process with the start command: + +```sh +postgrestools start +``` + +Then, every command needs to add the `--use-server` options, e.g.: + +```sh +echo "select 1" | biome check --use-server --stdin-file-path=dummy.sql +``` + +#### Daemon logs +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: + +- Linux: `~/.cache/pgt;` +- Windows: `C:\Users\\AppData\Local\supabase-community\pgt\cache` +- macOS: `/Users//Library/Caches/dev.supabase-community.pgt` +For other operative systems, you can find the folder in the system’s temporary directory. ## CI Setup diff --git a/mkdocs.yml b/mkdocs.yml index e744f81b..ca912bf6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -15,7 +15,7 @@ theme: nav: - Introduction: index.md - Guides: - - Linting Migrations: linting_migrations.md + - Linting Migrations: checking_migrations.md - Troubleshooting: troubleshooting.md - Reference: - Rules: rules.md From 1d1307c7f3d6c0fb3d37d763032f27bc7b75bcfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Steinr=C3=B6tter?= Date: Wed, 26 Mar 2025 14:54:47 +0100 Subject: [PATCH 2/7] Update index.md Co-authored-by: Julian Domke <68325451+juleswritescode@users.noreply.github.com> --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index ca9b4cd0..7e959b92 100644 --- a/docs/index.md +++ b/docs/index.md @@ -120,7 +120,7 @@ Postgres Tools has LSP first-class support. If your editor does implement LSP, t Postgres Tools has a command called `lsp-proxy`. When executed, two processes will spawn: - a daemon that does execute the requested operations; - a server that functions as a proxy between the requests of the client - the editor - and the server - the daemon; -If your editor is able to interact with a server and send [JSON-RPC](https://www.jsonrpc.org) request, you only need to configure the editor run that command. +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. #### Use the daemon with the binary 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. From ae9b7b66380fb31aa8bd13fff2a41b6bbef132cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Steinr=C3=B6tter?= Date: Wed, 26 Mar 2025 14:54:53 +0100 Subject: [PATCH 3/7] Update index.md Co-authored-by: Julian Domke <68325451+juleswritescode@users.noreply.github.com> --- docs/index.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/index.md b/docs/index.md index 7e959b92..88d818d0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -145,6 +145,8 @@ The daemon saves logs in your file system. Logs are stored in a folder called `p For other operative systems, you can find the folder in the system’s temporary directory. +You can change the location of the `pgt-logs` folder via the `PGT_LOG_PATH` variable. + ## CI Setup > [!NOTE] From ecb57c9e18fe18ee20ef8296c8b90ac0f1b91068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Steinr=C3=B6tter?= Date: Wed, 26 Mar 2025 14:55:00 +0100 Subject: [PATCH 4/7] Update index.md Co-authored-by: Julian Domke <68325451+juleswritescode@users.noreply.github.com> --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 88d818d0..49eba130 100644 --- a/docs/index.md +++ b/docs/index.md @@ -25,7 +25,7 @@ Our current focus is on refining and enhancing these core features while buildin ## Installation -To install Postgres Tools, grab the executable for your platform from the [latest CLI release](https://github.com/supabase-community/postgres_lsp/releases) on GitHub and give it execution permission. +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. ```sh curl -L https://github.com/supabase-community/postgres_lsp/releases/download//postgrestools_aarch64-apple-darwin -o postgrestools From 3f3b9210126e796b906f8d72454d2549c21da68f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Steinr=C3=B6tter?= Date: Wed, 26 Mar 2025 14:55:09 +0100 Subject: [PATCH 5/7] Update index.md Co-authored-by: Julian Domke <68325451+juleswritescode@users.noreply.github.com> --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 49eba130..1af244d5 100644 --- a/docs/index.md +++ b/docs/index.md @@ -124,7 +124,7 @@ If your editor is able to interact with a server and send [JSON-RPC](https://www #### Use the daemon with the binary 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. -If order to do so, you first need to start a daemon process with the start command: +In order to do so, you first need to start a daemon process with the start command: ```sh postgrestools start From abba8b55a7df0a0241dcde1bb7d533d05862360b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Steinr=C3=B6tter?= Date: Wed, 26 Mar 2025 14:55:15 +0100 Subject: [PATCH 6/7] Update index.md Co-authored-by: Julian Domke <68325451+juleswritescode@users.noreply.github.com> --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 1af244d5..4023b3c0 100644 --- a/docs/index.md +++ b/docs/index.md @@ -113,7 +113,7 @@ You will have to install `nvim-lspconfig`, and follow the [instructions](https:/ ### Other -Postgres Tools has LSP first-class support. If your editor does implement LSP, then the integration of Postgres Tools should be seamless. +Postgres Tools has first-class LSP support. If your editor does implement LSP, then the integration of Postgres Tools should be seamless. #### Use the LSP Proxy From bc49efa83bd97525804eb42846b8959d32e060ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Steinr=C3=B6tter?= Date: Wed, 26 Mar 2025 14:55:21 +0100 Subject: [PATCH 7/7] Update index.md Co-authored-by: Julian Domke <68325451+juleswritescode@users.noreply.github.com> --- docs/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/index.md b/docs/index.md index 4023b3c0..6737a903 100644 --- a/docs/index.md +++ b/docs/index.md @@ -34,7 +34,7 @@ chmod +x postgrestools Now you can use Postgres Tools by simply running `./postgrestools`. -If you are using Node anyways, you can also install the CLI via NPM. Run the following commands in a directory containing a `package.json` file. +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. ```sh pnpm add --save-dev --save-exact @postgrestools/postgrestools