# supabase-community/postgres-language-server

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/supabase-community-postgres-language-server).**

5,175 stars · 111 forks · Rust · mit

## Links

- GitHub: https://github.com/supabase-community/postgres-language-server
- Homepage: http://pg-language-server.com/
- awesome-repositories: https://awesome-repositories.com/repository/supabase-community-postgres-language-server.md

## Topics

`language-server-protocol` `postgres`

## Description

This project is a Language Server Protocol implementation for PostgreSQL that provides autocompletion, syntax diagnostics, and type checking for SQL and PL/pgSQL. It functions as a database schema validator and a static analysis engine designed to detect security vulnerabilities, performance bottlenecks, and dangerous migration patterns in database scripts.

The server differentiates itself by using live database connections to provide schema-aware intelligence, allowing it to verify that tables, columns, and data types actually exist. It performs static analysis on procedural functions to detect type mismatches, unused variables, and injection vulnerabilities, and utilizes explain-based insights to validate syntax and types.

Broad capability areas include IDE integration for context-aware identifier suggestions and object inspection, as well as CLI tooling for automating migration linting within CI pipelines. The toolset also covers database performance analysis to identify inefficient indexing and table bloat, and provides SQL code formatting to standardize script layouts.

Connection strings and project behavior are managed through environment variables and project-specific configuration files.

## Tags

### Development Tools & Productivity

- [Language Server Integrations](https://awesome-repositories.com/f/development-tools-productivity/language-server-integrations.md) — Implements the Language Server Protocol to provide IDE-agnostic code intelligence for PostgreSQL. ([source](https://pg-language-server.com/latest/getting_started/))
- [Language Servers](https://awesome-repositories.com/f/development-tools-productivity/language-servers.md) — Provides a full Language Server Protocol implementation for PostgreSQL SQL and PL/pgSQL with diagnostics and type checking.
- [Database Identifier Autocompletion](https://awesome-repositories.com/f/development-tools-productivity/autocomplete-providers/database-identifier-autocompletion.md) — Provides real-time autocompletion for tables, columns, and functions based on the connected database. ([source](https://pg-language-server.com/latest/features/editor_features/))
- [Procedural Language Diagnostics](https://awesome-repositories.com/f/development-tools-productivity/real-time-code-diagnostics/procedural-language-diagnostics.md) — Provides real-time language server diagnostics specifically for procedural database functions. ([source](https://cdn.jsdelivr.net/gh/supabase-community/postgres-language-server@main/README.md))
- [SQL Intelligence Engines](https://awesome-repositories.com/f/development-tools-productivity/sql-intelligence-engines.md) — Offers autocompletion, hover information, and syntax diagnostics using a native parser to ensure compatibility. ([source](https://cdn.jsdelivr.net/gh/supabase-community/postgres-language-server@main/README.md))
- [Hover Information Displays](https://awesome-repositories.com/f/development-tools-productivity/symbol-navigation/hover-information-displays.md) — Displays detailed information about database objects when hovering over identifiers in the editor. ([source](https://pg-language-server.com/latest/guides/configure_database/))
- [Editor Integrations](https://awesome-repositories.com/f/development-tools-productivity/code-editors-ides/extension-ecosystems-management/editor-extensions/editor-integrations.md) — Integrates standardized SQL capabilities and syntax checks directly into various code editors. ([source](https://pg-language-server.com/latest/guides/ide_setup/))
- [SQL Formatters](https://awesome-repositories.com/f/development-tools-productivity/code-quality-analysis/static-analysis-engines/static-analysis-tools/code-formatting-tools/sql-formatters.md) — Standardizes the layout and style of SQL files to ensure consistent presentation. ([source](https://cdn.jsdelivr.net/gh/supabase-community/postgres-language-server@main/README.md))
- [Database Schema Explorers](https://awesome-repositories.com/f/development-tools-productivity/database-schema-explorers.md) — Inspects running databases to detect performance issues, security vulnerabilities, and configuration problems. ([source](https://pg-language-server.com/latest/features/database_linting/))
- [In-Editor Statement Execution](https://awesome-repositories.com/f/development-tools-productivity/in-editor-statement-execution.md) — Runs SQL statements directly from the code editor using context-aware actions. ([source](https://pg-language-server.com/latest/guides/configure_database/))

### Part of an Awesome List

- [Database Schema Linting](https://awesome-repositories.com/f/awesome-lists/devtools/sql-analysis-and-linting/database-schema-linting.md) — Scans schema change files in CI pipelines to detect dangerous operations or syntax errors before deployment. ([source](https://pg-language-server.com/latest/guides/continuous_integration/))
- [SQL Static](https://awesome-repositories.com/f/awesome-lists/devtools/type-checking/sql-static.md) — Validates column and table types by analyzing execution plans to find runtime errors before execution. ([source](https://pg-language-server.com/latest/))
- [Performance Analysis](https://awesome-repositories.com/f/awesome-lists/data/performance-analysis.md) — Scans database schemas to identify inefficient indexes, missing primary keys, and table bloat. ([source](https://pg-language-server.com/latest/reference/database_rules/))
- [SQL Analysis and Linting](https://awesome-repositories.com/f/awesome-lists/devtools/sql-analysis-and-linting.md) — Scans scripts using rule sets to identify performance bottlenecks, dangerous migrations, and syntax anti-patterns. ([source](https://pg-language-server.com/latest/reference/rule_sources/))
- [SQL Safety Analysis](https://awesome-repositories.com/f/awesome-lists/devtools/sql-analysis-and-linting/sql-safety-analysis.md) — Analyzes code to identify dangerous operations that cause table rewrites, long locks, or accidental data loss. ([source](https://pg-language-server.com/latest/reference/rules/))
- [SQL and Database Analysis](https://awesome-repositories.com/f/awesome-lists/devtools/sql-and-database-analysis.md) — Scans SQL files and versioned changes for syntax and logic errors using database connection details. ([source](https://pg-language-server.com/latest/reference/cli/))
- [Security and Vulnerability Scanning](https://awesome-repositories.com/f/awesome-lists/security/security-and-vulnerability-scanning.md) — Identifies misconfigured security policies and exposed sensitive data within database scripts to prevent unauthorized access. ([source](https://pg-language-server.com/latest/reference/database_rules/))

### Data & Databases

- [Database Connectivity](https://awesome-repositories.com/f/data-databases/database-connectivity.md) — Establishes live connections to a Postgres instance to provide real-time schema intelligence. ([source](https://pg-language-server.com/latest/configuration/))
- [Schema Object Inspection](https://awesome-repositories.com/f/data-databases/database-object-editors/database-object-browsers/schema-object-inspection.md) — Displays detailed schema information, such as data types and parameters, when hovering over objects. ([source](https://pg-language-server.com/latest/features/editor_features/))
- [PL/pgSQL Static Analysis](https://awesome-repositories.com/f/data-databases/pl-pgsql-static-analysis.md) — Analyzes procedural functions and stored procedures to find logic errors, type mismatches, and security vulnerabilities.
- [Explain-Based Validation](https://awesome-repositories.com/f/data-databases/sql-abstract-syntax-tree-parsing/syntax-validation/explain-based-validation.md) — Performs type checking through explain-based error insights to lint database schemas and migrations. ([source](https://cdn.jsdelivr.net/gh/supabase-community/postgres-language-server@main/README.md))
- [LSP Integrations](https://awesome-repositories.com/f/data-databases/sql-query-editors/lsp-integrations.md) — Implements a standardized LSP interface to provide database-aware intelligence and formatting across compatible code editors.
- [Schema-Aware Autocompletion](https://awesome-repositories.com/f/data-databases/sql-query-interfaces/schema-aware-autocompletion.md) — Provides real-time autocompletion for tables, columns, and functions based on the connected PostgreSQL schema. ([source](https://pg-language-server.com/latest/guides/configure_database/))
- [SQL Static Analyzers](https://awesome-repositories.com/f/data-databases/sql-static-analyzers.md) — Analyzes SQL scripts to detect security vulnerabilities, performance bottlenecks, and dangerous migration patterns.
- [SQL Syntax Checking](https://awesome-repositories.com/f/data-databases/sql-syntax-checking.md) — Identifies syntax errors and provides diagnostics using a native database parser to ensure compatibility. ([source](https://pg-language-server.com/latest/))
- [Procedural Language Tooling](https://awesome-repositories.com/f/data-databases/stored-procedures/procedural-code-conversion/procedural-language-tooling.md) — Applies language-aware tooling and diagnostics to procedural functions and stored procedures. ([source](https://pg-language-server.com/latest/))
- [SQL Query Editors](https://awesome-repositories.com/f/data-databases/sql-query-editors.md) — Provides an interactive environment for writing and refining SQL queries with real-time autocompletion.
- [Procedural Logic Inspection](https://awesome-repositories.com/f/data-databases/stored-procedures/procedural-code-conversion/procedural-sql-execution/procedural-logic-inspection.md) — Analyzes procedural code using specialized extensions to identify logic errors and potential bugs. ([source](https://pg-language-server.com/latest/guides/configure_database/))

### Programming Languages & Runtimes

- [Database Schema Validators](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/type-system-tools/type-safety/compile-time-type-generation/database-schema-validators.md) — Checks SQL scripts against a running database to ensure tables, columns, and data types exist.

### Software Engineering & Architecture

- [Strongly-Typed Query Validation](https://awesome-repositories.com/f/software-engineering-architecture/data-schema-validation/data-type-validation/strongly-typed-query-validation.md) — Checks query validity using the database engine to ensure type correctness and object resolution. ([source](https://pg-language-server.com/latest/guides/configure_database/))

### Testing & Quality Assurance

- [PL/pgSQL](https://awesome-repositories.com/f/testing-quality-assurance/code-quality-review/static-analysis/pl-pgsql.md) — Analyzes PL/pgSQL function bodies to detect type mismatches, unused variables, and injection vulnerabilities. ([source](https://pg-language-server.com/latest/features/plpgsql/))

### Web Development

- [SQL Schema Validators](https://awesome-repositories.com/f/web-development/schema-validation/sql-schema-validators.md) — Verifies that tables, columns, and data types exist by checking queries against a live database schema. ([source](https://pg-language-server.com/latest/features/type_checking/))
