The PostgresTools extension for Visual Studio Code brings PostgreSQL inline suggestions, linting, and type checks to VSCode and VSCode-based editors.
The PostgresTools extension for VS Code is not yet distributed but will soon be available via the Visual Studio Marketplace and the Open VSX Registry.
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 via node_modules, the extension will look for the matching binary in your
node_modules. - If you have installed postgrestools via 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, you will be prompted to download a binary from
postgrestools'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.toml 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.