Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,38 @@
To install navigate to: **Zed** > **Extensions**. Or use the command palette ([macOS](https://github.com/zed-industries/zed/blob/main/assets/keymaps/default-macos.json#L581), [Linux](https://github.com/zed-industries/zed/blob/main/assets/keymaps/default-linux.json#L459)) to search `extensions`.

This extension integrates the [Postgresql Language Server](https://github.com/supabase-community/postgres-language-server).

## Project Setup

The language server will not provide diagnostics, autocomplete, or hover until it finds a configuration file. **You must create a `postgres-language-server.jsonc` file at the root of your project** and fill in your database connection details.

### 1. Create `postgres-language-server.jsonc` at the project root

```jsonc
{
"$schema": "https://pg-language-server.com/latest/schema.json",
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"db": {
"host": "127.0.0.1",
"port": 5432,
"username": "postgres",
"password": "postgres",
"database": "postgres",
"connTimeoutSecs": 10,
"allowStatementExecutionsAgainst": ["127.0.0.1/*", "localhost/*"]
}
}
```

Replace the values under `db` with your own connection details. Use the discrete fields shown above.

### 2. Reload Zed

Reopen the workspace (or restart Zed) so the language server picks up the new configuration.

For the full configuration reference (linter rules, formatter, type checking, etc.) see the upstream [Postgres Language Server documentation](https://pg-language-server.com/latest/).