Postgres Language Server
lastmod 2025-03-30created 2023-08-072 edits
A Language Server for Postgres
Features
- Introduces the Postgres Language Server, a tool under active development designed to improve the developer experience with Postgres
- The Language Server Protocol is an open protocol that provides code intelligence tools such as code completion and syntax highlighting; the Postgres Language Server implements this protocol specifically for Postgres
- The server provides features such as semantic highlighting, syntax error diagnostics, SQL comment display, autocompletion, code execution, and code formatting
- The motivation for the project is that existing IDEs and editors have limited support for PL/pgSQL, and generic SQL Language Servers fall short when handling PostgreSQL's complex syntax
- The Postgres Language Server uses libpg_query to parse SQL code reliably using the PostgreSQL source. This approach may be unconventional, but it is the only reliable way to parse every valid PostgreSQL query
- Once the parser is stabilized and a robust data model is implemented, the language server will provide basic features and serve as the user interface for all Postgres ecosystem tools
- The roadmap includes completing the parser, implementing a robust data model, setting up the language server properly, implementing basic language server features, integrating existing open-source tools, and building the missing pieces
- The project is not yet ready for production use and is looking for collaborators for development
- The server can be installed using Cargo, Node, and npm. For VS Code users, both the server and the client extension can be installed by running specific commands