The PostgresTools extension for Visual Studio Code brings PostgreSQL inline suggestions, linting, and type checks to VSCode and VSCode-based editors.
- You need a
postgrestools.jsonc
file at the root of your repository (or, use a custom file location and point to it via thepostgrestools.configFile
setting.) - You need an LSP binary.
The VSCode extension looks for the postgrestools
binary and uses it to start an LSP background process. It then creates a VSCode LSP Client and connects it to the server.
It'll try five strategies to find the binary, in the following order:
- The
postgrestools.bin
VSCode setting can point to a binary with relative or absolute paths. - If you have installed
@postgrestools/postgrestools
via node_modules, the extension will look for the matching binary in yournode_modules
. - If you have installed
@postgrestools/postgrestools
via Yarn Plug'n'Play, the extension will check your.pnp.cjs
file for a binary. - The extension will scan your $PATH for a
postgrestools
on Darwin/Linux orpostgrestools.exe
on Windows. - If no binary will be found and you have no
package.json
at the root of your repository, you will be prompted to download a binary frompostgrestools
's Github Releases. You can always download a CLI version via VSCode's Command Palette. (If you want to download prereleases, setpostgrestools.allowDownloadPrereleaes
in your VSCode settings.)
To connect to your database, postgrestools
needs to read a postgrestools.jsonc
config file. By default, the extension will look for that file in your repository. You can specify an alternative path via the postgrestools.configFile
VSCode setting.
If you experience any issues, please report them at the postgres-lsp repository – we'll most frequently read issues there.