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.jsoncfile at the root of your repository (or, use a custom file location and point to it via thepostgrestools.configFilesetting.) - 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.binVSCode setting can point to a binary with relative or absolute paths. - If you have installed
@postgrestools/postgrestoolsvia node_modules, the extension will look for the matching binary in yournode_modules. - If you have installed
@postgrestools/postgrestoolsvia Yarn Plug'n'Play, the extension will check your.pnp.cjsfile for a binary. - The extension will scan your $PATH for a
postgrestoolson Darwin/Linux orpostgrestools.exeon Windows. - If no binary will be found and you have no
package.jsonat 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.allowDownloadPrereleaesin 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 language server repository – we'll most frequently read issues there.