Skip to content
CAI
Software that uses CAICheck a score

supabase-community/postgres-language-server

64.7

Adequate · 30 September 2026

86.7k

lines of production code

Rust

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a PostgreSQL Language Server and CLI tool that provides SQL analysis, linting, and formatting capabilities. It integrates with editors via the LSP protocol to offer features like syntax-aware autocompletion, hover information, and real-time diagnostics. The tool also performs database-level linting by connecting to PostgreSQL instances to detect schema issues, performance bottlenecks, and security misconfigurations using multiple rule engines. Additionally, it supports execution in browser environments via WebAssembly bindings and offers extensive CI/CD integration through various output formats.

How it got here

2023–2025 — Initial scaffolding and core feature implementation

57 changes.

The project established its foundational infrastructure, including a Rust-based workspace, Nix development environment, and multi-platform CLI distribution. Core language server capabilities were built from scratch, featuring a custom Tree-sitter grammar, syntax-aware completions, hover information, and a structured diagnostic system. The period also introduced comprehensive linting engines for SQL safety and database schema analysis, alongside a JSON-RPC daemon architecture for client-server communication.

2026 — Pretty printer and WASM bindings

13 changes.

This period focused on introducing core infrastructure for SQL formatting and browser-based execution. The team built a new SQL pretty printer with comprehensive test coverage and code generation tools, while simultaneously releasing WebAssembly bindings to enable the language server to run in browsers and Node.js environments.

Features

Add proc-macro crate for deriving Merge and Partial configuration structs

Introduces the \pgls\_configuration\_macros\ crate, providing two new derive macros: \Merge\ and \Partial\. The \Merge\ macro implements the \Merge\ trait for enums, structs, and newtypes, allowing configuration objects to be combined by overwriting fields. The \Partial\ macro generates a corresponding \Partial{StructName}\ struct where all fields are wrapped in \Option\, facilitating the construction of partial updates or patches for configuration objects. This new crate replaces previous biome dependencies and includes specific lint allowances for large enum variants.

_crates/pgls\_configuration\macros · high confidence

Added contact table seed data for test database

A new seed file (test-db/seed.sql) has been added to initialize the test database with a public.contact table. This table includes an auto-incrementing primary key, a timestamp for creation, and a username field, allowing tests to interact with contact records.

test-db · high confidence

Added example SQL file with user query and syntax errors

A new SQL file has been added to the examples directory containing a query to select user IDs and names for a specific ID, followed by lines containing invalid SQL syntax ('select select') and a simple 'select 1' statement.

example · high confidence

Automated CLI package generation for multi-platform WASM and native binaries

The CLI build process now includes a new script that automatically generates and configures npm packages for the Postgres Language Server. This script downloads pre-built WASM assets (pgls.js, pgls.wasm) and native binaries from GitHub releases, then creates platform-specific package directories (e.g., for Windows MSVC, macOS, and Linux glibc/musl on x86\_64 and aarch64). It updates package manifests to include the correct version and optional dependencies, ensuring users receive the appropriate binary for their OS and architecture without manual intervention.

packages/@postgres-language-server/cli/scripts · high confidence

Initial PostgreSQL tokenizer implementation

The \pgls\_tokenizer\ crate introduces a new lexer for PostgreSQL SQL syntax, enabling the system to recognize and categorize SQL tokens. This tokenizer supports standard identifiers, numeric literals (including binary, octal, hexadecimal, and decimal formats with separators), and various string types such as escaped strings, Unicode escape strings, bit strings, byte strings, and dollar-quoted strings. It also handles PostgreSQL-specific features like named parameters (using \@\, \:\, and \$\ prefixes) and positional parameters (\$1\, etc.), along with line and block comments. The implementation is based on the \squawk\_lexer\ and includes comprehensive snapshot tests to verify correct tokenization behavior.

_crates/pgls\tokenizer · high confidence

Initial SQL parsing queries for columns, relations, and aliases

The \crates/pgls\_treesitter/src/queries\ module now provides the foundational Tree-sitter query definitions and execution infrastructure for parsing SQL statements. This includes specific query handlers for extracting insert columns, select columns (with aliases), where-clause columns, table relations (with schema support), table aliases, and object references. The module introduces a \TreeSitterQueriesExecutor\ to run these queries against parsed SQL trees and returns structured results, enabling downstream components to identify and manipulate SQL elements like columns and tables.

_crates/pgls\treesitter/src/queries · high confidence

Initial implementation of LSP server handlers

This change introduces the core LSP protocol handlers for the pgls language server, including code actions, completions, configuration management, formatting, hover information, and text document lifecycle events (open, change, close). It adds support for executing SQL statements and invalidating the schema cache via code actions, implements syntax-aware completions with incomplete-list signaling for database connectivity issues, and debounces diagnostic updates to prevent stale analysis backlogs during rapid typing.

_crates/pgls\lsp/src/handlers · high confidence

Initial pretty-print code generation crate

Added the \pgls\_pretty\_print\_codegen\ crate, which provides procedural macros to generate Rust token and node-type enums from the \libpg\_query\ protobuf definitions. The build script downloads the \kwlist.h\ and \pg\_query.proto\ files for PostgreSQL 17 (libpg\_query 6.1.0) to drive this code generation, establishing the foundational parsing and formatting infrastructure for the project.

_crates/pgls\_pretty\_print\codegen · high confidence

Initial pretty-printer implementation for PostgreSQL AST nodes

The \pgls\_pretty\_print\ crate now includes a comprehensive set of emitter modules for PostgreSQL AST node types (such as expressions, constants, array operations, and various DDL statements like ALTER TABLE, ALTER FUNCTION, and ALTER EXTENSION). This adds the capability to format and pretty-print parsed PostgreSQL query structures into human-readable SQL text, handling syntax preservation, indentation, and line-breaking for complex statements.

_crates/pgls\_pretty\print/src/nodes · high confidence

Initial release of the SQL pretty printer

The \pgls\_pretty\_print\ crate is introduced, providing a new SQL formatter that transforms parsed ASTs into formatted SQL strings. It supports configurable layout options including \Layout::Expanded\ for breaking statements across lines, \CommaStyle\ for leading or trailing commas, \LogicalOperatorPlacement\ for boolean operators, \CastStyle\ for \::\ versus \CAST(...)\, and \ClauseBodyStyle\ for clause body indentation. The formatter preserves source comments by attaching them to AST nodes and re-emitting them in the output. It also normalizes boolean expressions and join types (e.g., \CROSS JOIN\ to \INNER JOIN ON TRUE\) to ensure semantic equivalence during beta validation.

_crates/pgls\_pretty\print/src · high confidence

Initial repository scaffolding and development environment setup

The repository has been initialized with the core configuration files and tooling required for development. This includes a Rust toolchain specification (channel 1.88.0), a Nix flake for reproducible development environments, and a Docker Compose setup for local PostgreSQL testing. The project adopts a new JavaScript/TypeScript tooling stack, replacing previous formatters and linters with Oxc (oxlint and oxfmt) and Bun, evidenced by the addition of \.oxlintrc.json\, \.oxfmtrc.json\, and \bun.lock\. Additionally, a default configuration file (\postgres-language-server.jsonc\) is provided to define default settings for the language server, including database connection parameters and enabled features like linting and type checking.

(repo-wide) · high confidence

Integrate pglinter extension for database linting

Added the \pgls\_pglinter\ crate to enable database-level linting via the \pglinter\ PostgreSQL extension. The build script automatically downloads the extension's SQL rules during compilation if the vendor directory is missing. The integration includes a cache layer to store extension state and rule messages, a diagnostic system for reporting violations, and a registry of generated rules covering base, schema, and cluster categories (such as missing primary keys, redundant indexes, and insecure authentication settings).

_crates/pgls\pglinter · high confidence

Introduce JSON-RPC backend for Postgres Language Server daemon

The backend-jsonrpc package now provides a client library to connect to the Postgres Language Server daemon via a JSON-RPC protocol over a local socket. This change introduces platform-specific binary resolution (supporting Windows, macOS, and Linux including musl) and implements the transport layer for sending requests and receiving diagnostics, formatting, and linting results from the remote daemon process.

packages/@postgrestools/backend-jsonrpc/src · high confidence

Introduce Splinter database linting engine

The new Splinter engine enables database-level linting by executing embedded SQL queries against the connected database to detect issues such as missing indexes, security misconfigurations, and performance bottlenecks. It provides a structured diagnostic system that reports severity, affected database objects, and remediation guidance, while supporting rule filtering via an analysis filter and allowing users to ignore specific database objects through global and per-rule configuration patterns.

_crates/pgls\splinter/src · high confidence

Introduce Splinter linter configuration with global and per-rule ignore patterns

The Splinter linter module is now configurable via \SplinterConfiguration\, allowing users to enable or disable the feature globally and define a list of Unix-style glob patterns (e.g., \schema.object\_name\) to ignore database objects across all rules. Additionally, \SplinterRuleOptions\ enables fine-grained filtering by specifying ignore patterns per rule, giving users precise control over which database objects are analyzed by the linter.

_crates/pgls\configuration/src/splinter · high confidence

Introduce comprehensive code generation infrastructure for analyser, bindings, and configuration

The \xtask/codegen\ tool now provides a unified code generation system that automates the creation of analyser rule structures, TypeScript bindings for the Workspace API, and configuration files for linters, splinter, and pglinter. This infrastructure generates Rust modules for lint categories and groups, produces TypeScript interfaces and factory functions for JavaScript/TypeScript consumers, and creates configuration structs based on rule metadata. It also includes utilities for generating new lint rules and crates, streamlining the development and maintenance of the analysis and configuration layers.

xtask/codegen · high confidence

Introduce context-aware hover information for SQL objects

The \pgls\_hover\ crate now provides detailed hover tooltips for tables, columns, functions, roles, schemas, and custom PostgreSQL types. Hovering over a table displays its kind (e.g., View, MaterializedView), RLS status, column list (up to 20 columns with types and constraints), and row/size estimates. Column hovers show the full qualified name, type, primary key/unique/nullability status, and default values. Function hovers include the signature, kind (Function, Procedure, Aggregate, Window), mutability, and security definer status. The system also implements contextual prioritization, scoring results based on the cursor's position relative to mentioned tables, aliases, and schemas to surface the most relevant matches first.

_crates/pgls\hover · high confidence

Introduce new CLI commands for database linting, schema export, and project initialization

The CLI now includes several new commands to manage and analyze your Postgres project. The \dblint\ command lints your database schema by pulling diagnostics from the workspace. The \schema\_export\ command connects to a PostgreSQL database and exports the schema cache as JSON, which is particularly useful for WASM bindings. Additionally, the \init\ command bootstraps a new project by creating a default \postgres-language-server.jsonc\ configuration file. These commands are integrated into the main CLI interface alongside existing commands like \check\, \format\, and \daemon\ management.

_crates/pgls\cli/src/commands · high confidence

Introduce pgls\_console for formatted console output

The new \pgls\_console\ crate provides a general abstraction for printing formatted messages and diagnostics to a console. It introduces a \Console\ trait with implementations for standard environment output (\EnvConsole\) and in-memory buffers (\BufferConsole\), supporting color modes and log levels. The crate includes a \markup!\ macro for defining styled text elements (such as emphasis, colors, and hyperlinks) and handles rendering to both terminal (via termcolor) and HTML outputs, along with comprehensive compile-time tests for the markup syntax.

_crates/pgls\console · high confidence

Introduce pgls\_fs crate with unified file system abstraction

The new \pgls\_fs\ crate provides a unified file system abstraction for the Postgres Language Server, featuring a \FileSystem\ trait with implementations for both the operating system (\OsFileSystem\) and an in-memory store (\MemoryFileSystem\). This includes automatic configuration file discovery via \auto\_search\ (supporting \postgres-language-server.jsonc\ and the deprecated \postgrestools.jsonc\), a \PathInterner\ for efficient path deduplication, and a \PgLSPath\ type that tracks file priority (Config, Ignore, Inspectable, Handleable) and write status. The crate also exposes an \ignored\_path\ procedural macro to simplify workspace server logic by automatically returning default values when a path is ignored by user settings.

_crates/pgls\fs · high confidence

Introduce pgls\_lexer with named parameter context awareness and blank-line preservation

The new pgls\_lexer crate provides SQL lexing with structured diagnostics and parameter handling. It now correctly distinguishes named parameters used as identifiers (e.g., in TO, FROM, TABLE, ALTER, DROP contexts) from value placeholders, enabling accurate conversion to positional parameters while preserving source-length padding for reversible formatting. The lexer also tracks blank lines, allowing downstream tools to preserve them in formatted output.

_crates/pgls\lexer · high confidence

Introduce pgls\_query crate for SQL parsing and analysis

The new \pgls\_query\ crate provides a Rust interface to the \libpg\_query\ library, enabling SQL parsing, decompilation (deparsing), normalization, fingerprinting, scanning, and statement splitting. It exposes a high-level API for converting SQL strings into abstract syntax trees and back, generating stable fingerprints for query comparison, and normalizing literals into parameters. The crate includes a build system that supports both vendored and system-installed \libpg\_query\ dependencies, with specific support for WebAssembly (WASM) targets via Emscripten, and generates Rust bindings and protobuf structures automatically.

_crates/pgls\_schema\cache · high confidence

Introduce pgls\_suppressions crate for lint suppression handling

Added the new \pgls\_suppressions\ crate, which provides the core logic for parsing and applying lint suppressions in SQL files. This includes a parser that recognizes \-- pgt-ignore\ and \-- pgls-ignore\ comments (supporting file, line, and range-based scopes), a line-index utility for mapping text offsets to line numbers, and logic to detect unused or disabled suppressions. This change enables users to selectively disable specific lints via comments.

_crates/pgls\suppressions · high confidence

Introduce static diagnostic category registry with compile-time generation

The \pgls\_diagnostics\_categories\ crate now provides a centralized, static registry for all diagnostic categories used by the pg toolchain. A new build script generates Rust code from \src/categories.rs\, creating a compile-time registry that includes lint/safety rules, pglinter rules (base, cluster, schema), and splinter rules (performance, security), along with general categories like syntax and typecheck. This enables consistent categorization of diagnostics, automatic documentation link resolution, and macro-based lookup (\category!\, \category\_concat!\) for analyser rules, ensuring that all diagnostic codes are registered and validated at compile time.

_crates/pgls\_diagnostics\categories · high confidence

Introduce structured diagnostics framework with rich console and GitHub Actions output

The \pgls\_diagnostics\ crate now provides a comprehensive error-handling and reporting system. It defines a \Diagnostic\ trait that allows errors to carry structured metadata such as category, severity, tags (e.g., FIXABLE, INTERNAL), and location context. This enables richer user feedback, including code frames, diffs, and command suggestions. The framework includes adapters for standard error types (\std::error::Error\, \io::Error\, \serde\_json::Error\, \bpaf::ParseFailure\, \oxc\_resolver::ResolveError\) to seamlessly integrate existing errors into the new system. Display logic has been added to render these diagnostics as formatted console output (with hyperlinks, colors, and indentation) and as GitHub Actions workflow commands for CI/CD integration.

_crates/pgls\diagnostics · high confidence

Introduce syntax-aware SQL autocompletions

The \pgls\_completions\ crate now provides context-aware autocompletion for PostgreSQL statements. It uses the \tree-sitter\ incremental parser to analyze incomplete SQL at the cursor position and suggests items such as tables, columns, functions, schemas, policies, roles, and keywords. The system ranks these suggestions based on relevance and filters them according to the current SQL context (e.g., ignoring columns in a \FROM\ clause), ensuring that only appropriate completions are displayed in the editor.

_crates/pgls\completions · high confidence

Introduce the pgls\_statement\_splitter crate

The new \pgls\_statement\_splitter\ crate provides a \split\ function that breaks SQL source strings into individual statement ranges. It handles complex syntax including CTEs (with optional \MATERIALIZED\ hints), \EXPLAIN\ prefixes, and \ALTER\ statements, while preserving blank lines within statements unless they serve as recovery boundaries for unparseable fragments. The release includes a benchmark suite for performance validation and a comprehensive set of data-driven tests covering DDL, DML, and edge cases like blank lines and comments.

_crates/pgls\_statement\splitter · high confidence

Introduce workspace feature modules for code actions, completions, diagnostics, formatting, and hover

The workspace now exposes structured feature modules that define the request and response types for core editor capabilities. Users can now interact with code actions (including executing statements and invalidating schema caches), retrieve completions with improved statement boundary handling, pull file and database diagnostics, format SQL with range support, and view hover information. These modules establish the data contracts for these features within the workspace layer.

_crates/pgls\workspace/src/features · high confidence

Introduce workspace server with database connection pooling and schema caching

This change adds the core workspace server implementation, introducing a connection manager that caches database pools keyed by credentials and automatically invalidates them when connection settings change, alongside a schema cache manager that loads and caches database schemas per connection. The server also includes an analyser visitor builder to register lint and splinter rules, a document model for parsing and managing SQL statements, and supporting stores for AST (pg\_query), concrete syntax trees (tree-sitter), and statement annotations.

_crates/pgls\workspace/src/workspace/server · high confidence

Introduces OS-specific daemon transport layer for CLI-server communication

The CLI now manages a background server daemon using platform-specific transport mechanisms: Unix systems use a domain socket located in the global cache directory, while Windows uses a named pipe. The \pgls\_cli/src/service\ module implements the logic to spawn the daemon process, ensure it is running and ready to accept connections, and handle the asynchronous read/write channels for JSON-RPC messages. This change establishes the foundational communication layer between the CLI and the server, including timeout handling and pending request management.

_crates/pgls\cli/src/service · high confidence

Introduces a new JSON-RPC backend for connecting to the Postgres Language Server daemon

This change adds a new \backend-jsonrpc\ package that enables the language client to communicate with the Postgres Language Server via a remote daemon process. It includes platform-specific binary detection (supporting Windows, macOS, and Linux/glibc/musl), a socket-based transport layer implementing the JSON-RPC 2.0 protocol with HTTP-like headers, and a generated TypeScript workspace API. This allows users to leverage the daemon's advanced features, such as the new linting rules (pglinter, splinter) and formatting options, through a standardized remote interface.

packages/@postgres-language-server/backend-jsonrpc · high confidence

Introduction of Safety lint rules for database schema changes

The linter configuration now includes a new 'Safety' rule group designed to detect database schema modifications that can cause performance issues or lock contention. This group covers rules such as \add\_serial\_column\, \adding\_field\_with\_default\, \adding\_foreign\_key\_constraint\, \adding\_not\_null\_field\, \adding\_primary\_key\_constraint\, \adding\_required\_field\, \avoid\_adding\_exclusion\_constraint\, \avoid\_alter\_enum\_add\_value\, \avoid\_attaching\_partition\, \avoid\_create\_trigger\, \avoid\_enable\_disable\_trigger\, and \avoid\_wide\_lock\_window\. Users can enable these rules via the \recommended\ or \all\ flags in their configuration to receive warnings about potentially risky DDL operations.

_crates/pgls\configuration/src/linter · high confidence

LSP server initialization with sticky client configuration and position encoding support

The \pgls\_lsp\ server now supports negotiating LSP position encodings (UTF-8, UTF-16, UTF-32) to correctly map cursor positions and ranges for editors using different character encodings. Additionally, it introduces a sticky client configuration override layer that allows the editor to push runtime settings (such as database connection details or search paths) which take precedence over file-based and environment configurations for the current session, ensuring that live editor instructions are not silently overridden by static environment variables.

_crates/pgls\lsp/src · high confidence

New @postgres-language-server/wasm package for browser and Node.js SQL tooling

The new \@postgres-language-server/wasm\ package exposes the Postgres Language Server as WebAssembly bindings, offering two distinct APIs for SQL development in the browser and Node.js. The \*\Workspace API\\* (\@postgres-language-server/wasm/workspace\) provides a direct, lightweight interface for parsing, linting, code completion, and hover information, making it suitable for custom editor integrations or build-time tooling. The \*\LanguageServer API\\* (\@postgres-language-server/wasm/lsp\) implements the full LSP JSON-RPC protocol, enabling integration with standard LSP clients like Monaco Editor via web workers. The package also includes TypeScript types for schema caching and comprehensive E2E tests to verify the integration.

packages/@postgres-language-server/wasm · high confidence

New CLI reporting formats and file-targeting options

The CLI now supports multiple output reporters via the \--reporter\ flag, including \json\, \json-pretty\, \summary\, \github\, \junit\, and \gitlab\, allowing diagnostics to be formatted for CI/CD integration or machine parsing. Additionally, the \check\ and \format\ commands now accept \--changed\ and \--since\ arguments to target only modified files relative to a base branch or specific commit, and a \--staged\ flag to process only git-staged files.

_crates/pgls\cli/src · high confidence

New PostgreSQL Language Server grammar crate for LSP autocompletion

The \pgls\_treesitter\_grammar\ crate has been introduced to provide a custom tree-sitter grammar for PostgreSQL, specifically designed to support Language Server Protocol features like autocompletion and hover information. The grammar uses specific identifier types (e.g., \column\_identifier\, \table\_reference\) and partial parsing rules to enable accurate suggestions while users are typing incomplete SQL statements. It includes an external C scanner for handling dollar-quoted strings, a Rust build script for generating the parser, and benchmarking tests to measure parsing performance.

_crates/pgls\_treesitter\grammar · high confidence

New Splinter lint rules for performance and security

The \pgls\_splinter\ crate now includes a generated set of lint rules organized into \performance\ and \security\ categories. The performance rules detect issues such as duplicate indexes, unindexed foreign keys, unused indexes, missing primary keys, table bloat, multiple permissive RLS policies, and inefficient RLS policy functions. The security rules flag exposed \auth.users\ data, extensions in the public schema, outdated extension versions, foreign keys to auth unique constraints, foreign tables accessible via API, functions with mutable search paths, insecure queues exposed in APIs, and materialized views accessible over APIs. These rules are automatically registered under the \Splinter\ lint category and can be configured via the \splinter.rules\ JSON configuration.

_crates/pgls\splinter/src/rules · high confidence

New pattern matching library for file and path filtering

The \pgls\matcher\ crate has been introduced to provide Unix shell-style pattern matching capabilities for files and paths. It allows users to define glob patterns (supporting \\\, \\\\, \\[...\]\, and \{...}\ syntax) to match against strings or file paths, with options for case sensitivity and literal separators. This component enables the system to filter or ignore specific database objects and files based on configurable patterns, handling both exact string matches and path-based matching with ancestor checks for single-file patterns.

_crates/pgls\matcher · high confidence

New rules\_check tool for validating lint rule documentation

A new \rules\_check\ utility has been added to the \xtask\ suite. This tool scans the registered lint rules and validates their associated documentation code blocks, ensuring that each example produces the expected diagnostic output (or none) and fails if the analysis returns unexpected results. This helps maintain the accuracy and consistency of the linter's documentation.

_xtask/rules\check · high confidence

New safety lint rules for PostgreSQL migration safety

The analyser now includes a comprehensive set of safety lint rules (the 'safety' category) designed to prevent downtime during schema migrations. These rules detect operations that cause full table rewrites or acquire blocking locks, such as adding SERIAL columns, adding columns with volatile defaults, adding foreign keys without NOT VALID, setting NOT NULL constraints on existing data, and adding exclusion constraints. The linter also warns against using ALTER TYPE ... ADD VALUE in transaction blocks on older Postgres versions and attaching partitions without precautions. Users will receive warnings or errors for these patterns, with suggestions for safer alternatives like concurrent index creation, NOT VALID constraints, and separate validation steps.

_crates/pgls\analyser · high confidence

Typechecker now validates CREATE TABLE AS, CREATE VIEW, and CREATE MATERIALIZED VIEW statements

The \pgls\_typecheck\ crate now performs type-checking on the query bodies of \CREATE TABLE AS\, \CREATE VIEW\, and \CREATE MATERIALIZED VIEW\ statements. Previously, these constructs were not validated; the new logic extracts the inner \SELECT\ query, applies identifier replacements, and checks it against the database schema. This ensures that invalid column references or type mismatches within these definitions are now caught and reported as diagnostics, just like in standard \SELECT\, \INSERT\, \UPDATE\, or \DELETE\ queries.

_crates/pgls\typecheck · high confidence

WASM bindings for browser-based Postgres language server features

The \pgls\_wasm\ crate now provides WebAssembly bindings, enabling the Postgres language server to run in browser environments. This includes a build script (\build-wasm.sh\) and Nix flake for compiling the Rust code to WASM via Emscripten, exposing both a direct Workspace API (for parsing, linting, and completions) and a full LSP JSON-RPC handler for integration with editors like Monaco. Users can now leverage SQL analysis capabilities directly in the browser without a backend server.

_crates/pgls\wasm · high confidence

Workspace configuration and file-matching subsystem introduced

The workspace module now provides a complete configuration loading pipeline that reads \postgres-language-server.jsonc\ files, strips JSONC comments and trailing commas, and resolves \extends\ references. It also introduces a new \Matcher\ component for handling Unix shell-style glob patterns (including \\\\ recursive wildcards and character classes) to determine which files are ignored or processed, alongside a \Dome\ structure for iterating over specific path types like configuration and ignore files within the workspace.

_crates/pgls\workspace/src · high confidence

Behavioural changes

Added Tree-sitter helper utilities for syntax-aware completions

The \pgls\_treesitter\ crate now exposes helper functions (\goto\_node\_at\_position\, \goto\_previous\_leaf\, \goto\_closest\_unfinished\_parent\_clause\, \previous\_sibling\_completed\) and a list of single-token rules. These utilities enable the language server to navigate the syntax tree and determine clause completion status, which is required for providing syntax-aware completions for SELECT statements.

_crates/pgls\treesitter/src · medium confidence

Build-time download of Splinter linting rules

The build process now automatically downloads the latest Supabase Splinter SQL linting rules from the GitHub repository during compilation. A new build script checks for the presence of local vendor files and compares their commit SHA against the expected version; if the files are missing or outdated, it fetches the relevant SQL rule files via the GitHub API and stores them locally. This ensures that the tool always uses the correct, up-to-date set of linting rules without requiring manual updates to the repository's vendored content.

_crates/pgls\splinter · high confidence

CLI now delegates to platform-specific prebuilt binaries

The Postgres Language Server CLI has been updated to automatically detect the user's operating system (Windows, macOS, Linux/glibc, Linux/musl) and CPU architecture, then execute the corresponding prebuilt binary from the appropriate sub-package (e.g., cli-x86\_64-windows-msvc). This replaces any previous inline or generic execution logic, ensuring the CLI uses optimized native binaries for the detected environment. If no prebuilt binary is available for the detected platform, the CLI now exits with a clear error message directing users to file an issue.

packages/@postgres-language-server/cli/bin · high confidence

Configurable PL/pgSQL check warnings and improved diagnostic reporting

The \pgls\_plpgsql\_check\ crate now exposes granular control over PL/pgSQL analysis via new parameters (e.g., \fatal\_errors\, \extra\_warnings\, \performance\_warnings\, \security\_warnings\, \compatibility\_warnings\, \constant\_tracing\), allowing users to tailor the strictness and scope of checks. Additionally, diagnostic output has been enhanced to include SQL state codes, detail messages, and hints provided by the underlying \plpgsql\_check\ engine, and span resolution has been fixed to correctly handle multibyte character offsets in function bodies.

_crates/pgls\_plpgsql\check · high confidence

Improved SQL context tracking with scope boundaries and ancestor analysis

The context engine now tracks SQL scope boundaries (such as statements, blocks, transactions, and psql meta-commands) to better isolate parsing contexts. It also maintains a detailed history of ancestor nodes and their field relationships, enabling more accurate identification of the current SQL clause and surrounding structure for features like completions.

_crates/pgls\treesitter/src/context · high confidence

Introduce dedicated CLI execution engine for check and format modes

The CLI now uses a new execution module in \crates/pgls\_cli/src/execute\ to handle file processing, replacing previous ad-hoc logic. This module introduces \ExecutionConfig\ and \ExecutionMode\ to explicitly distinguish between \check\ (read-only linting) and \format\ (code modification) operations. It implements a file traversal system (\walk.rs\) that processes files via \process\_file\, routing them to specific \check\_file\ or \format\_file\ handlers. The \format\_file\ handler now supports writing changes to disk when \allows\_writes\ is true, or generating diffs for display otherwise, while \check\_file\ focuses on pulling and reporting diagnostics. A new \WorkspaceFile\ wrapper manages file I/O and workspace guards, and \diagnostics.rs\ provides extension traits for consistent error handling and reporting.

_crates/pgls\cli/src/execute · high confidence

Introduce structured configuration for database connections and credential redaction

The \pgls\_configuration\ crate now defines a dedicated \DatabaseConfiguration\ struct that manages connection parameters (host, port, username, password, database) and supports standard Postgres environment variables (\DATABASE\_URL\, \PGHOST\, \PGPORT\, \PGUSER\, \PGPASSWORD\, \PGDATABASE\) via a new \from\_env\ method. To prevent accidental exposure of sensitive data, the \Debug\ implementations for both \DatabaseConfiguration\ and \PartialDatabaseConfiguration\ now redact the \password\ and \connection\_string\ fields, replacing their values with \\[redacted\]\ in log output.

_crates/pgls\configuration/src · high confidence

New rule categorization and filtering system for the analyzer

The \pgls\_analyse\ crate now introduces a structured system for classifying and filtering lint rules. Rules are categorized into Lint, Action, or Transformation types, and code actions are mapped to LSP-standard categories (QuickFix, Refactor, Source) with specific sub-kinds like Extract or Inline. This change adds a filtering mechanism (\AnalysisFilter\) that allows users to enable or disable specific rules or entire groups by name, and to restrict analysis to specific categories. The system also includes a metadata registry to track rule information and sources (such as pgfence, Squawk, or Eugene).

_crates/pgls\analyse · high confidence

PostgreSQL keyword list updated to version 17

The lexer codegen crate now downloads and uses the PostgreSQL keyword list from the \17-latest\ tag of \libpg\_query\. This updates the set of recognized SQL keywords and syntax kinds to match PostgreSQL 17, ensuring the parser stays current with the latest database version.

_crates/pgls\_lexer\codegen · high confidence

PostgresTools CLI now supports Linux musl builds

The PostgresTools CLI package now detects and supports Linux environments using the musl libc (such as Alpine Linux) in addition to the existing glibc support. The entry-point script automatically identifies the libc type at runtime and routes to the appropriate prebuilt binary, ensuring the tool works correctly on musl-based systems where it previously failed or was unavailable.

packages/@postgrestools/postgrestools · high confidence

Rename internal crates to pgls\_\* prefix

The project's internal Rust crates have been renamed to use the \pgls\_\ prefix (e.g., \pgls\_markup\, \pgls\_query\_ext\, \pgls\_query\_macros\, \pgls\_test\_macros\). This change updates the module structure and import paths throughout the codebase to reflect the new naming convention, ensuring consistent identification of internal components.

(repo-wide) · high confidence

Support for standard PostgreSQL environment variables

The environment configuration module now recognizes standard PostgreSQL connection variables (PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE) alongside the existing DATABASE\_URL, allowing users to connect to the database using common conventions. Additionally, the module exposes these variables for display, masking sensitive values like passwords while showing the status of all connection parameters.

_crates/pgls\env · high confidence

Unified rule configuration and selector system across all analyzers

The configuration module has been refactored to introduce a generic \RuleConfiguration\ and \RuleSelector\ system that unifies how rules are defined and selected across the Linter, Splinter, and PgLinter analyzers. Users can now configure rule severity (Warn, Error, Info, Off) and options using a consistent structure, where overriding a rule's severity no longer discards its specific options. Additionally, rule selection is standardized via a \RuleSelector\ enum that parses prefixes like \lint/\, \splinter/\, and \pglinter/\, allowing users to target specific rules or entire groups from any analyzer using a uniform syntax.

_crates/pgls\configuration/src/rules · high confidence

Updated Splinter linter vendor with new performance and security checks

The Splinter vendor in this location has been updated to a newer commit (b9de3a3), introducing a suite of new database linter rules. Performance checks now detect unindexed foreign keys, duplicate or unused indexes, tables lacking primary keys, excessive table bloat, inefficient RLS policy evaluation patterns, and multiple permissive policies on the same role/action. Security checks now flag exposed auth users via views, extensions installed in the public schema, outdated extension versions, foreign keys referencing auth unique constraints, foreign tables accessible over APIs, functions with mutable search paths, insecure queues exposed in APIs, materialized views accessible over APIs, RLS policies existing without RLS enabled, RLS disabled on public tables, RLS enabled without policies, overly permissive RLS policies (e.g., USING true), and insecure references to user metadata in RLS policies.

_crates/pgls\splinter/vendor · high confidence

Workspace API refactored into client/server architecture with pull-based diagnostics

The workspace module has been restructured to separate the client and server concerns. A new \WorkspaceClient\ now handles outgoing JSON-RPC requests (such as \pgls/code\_actions\, \pgls/pull\_diagnostics\, and \pgls/invalidate\_schema\_cache\) to a \WorkspaceTransport\, enabling the workspace logic to be used in remote or WASM contexts. The \WorkspaceServer\ implements the \Workspace\ trait to process these requests locally, managing documents, schema caches, and settings. A key behavioral change is the introduction of 'pull-based' diagnostics: instead of pushing diagnostics automatically, the server now exposes \pull\_file\_diagnostics\ and \pull\_db\_diagnostics\ methods that clients must explicitly call to retrieve results. This change also includes fixes for handling unreachable database diagnostics and multiline suppression ranges.

_crates/pgls\workspace/src/workspace · high confidence

Test coverage

Added CLI integration tests for the PostgreSQL language server; Added diagnostics tests for Splinter rules; Added integration tests for the LSP server; Added multi-file SQL fixtures for pretty-printer testing; Added multi-file SQL snapshot tests for the pretty printer; Added regression and coverage tests for the pretty printer; Added single-statement test fixtures for the pretty printer; Added snapshot tests for CLI reporters and database linter; Added test snapshots for CLI reporters and database linter; Added tests for the JSON-RPC transport layer and workspace diagnostics; Initial snapshot tests for the pretty printer.

Dependencies

Initial dependency manifest and lockfile setup

The project now includes a Cargo.lock file and updated Cargo.toml manifests for the workspace and its constituent crates (such as pgls\_cli, pgls\_lsp, and pgls\_treesitter\_grammar). This establishes the resolved dependency graph, including specific versions for core libraries like tree-sitter, tokio, and sqlx, ensuring reproducible builds for the Postgres Language Server.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 65 → 65 (-0.5)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 77 → 77 (+0.3)
  • Architecture 99 → 97 (-2.2)
  • Maturity 60 → 60 (-0.5)
  • Readiness 76 → 67 (-9.6)
  • Security 58 → 64 (+6.1)
  • Domain Modelling 100 → 100 (+0.0)
  • Performance 71 (new)

Resolved (21)

  • Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no pnpm-resolved versions to grade)
  • Documentation: no installation or build instructions (docs/manual_installation.md)
  • Duplicated block (11–12 lines × 2) (crates/pgls_pretty_print/src/renderer.rs)
  • Duplicated block (12 lines × 2) (crates/pgls_pretty_print/src/renderer.rs)
  • Duplicated block (13 lines × 2) (crates/pgls_pretty_print/src/nodes/insert_stmt.rs)
  • FunctionTooLong: pgls_pretty_print::nodes::create_stmt::emit_create_stmt (crates/pgls_pretty_print/src/nodes/create_stmt.rs)
  • FunctionTooLong: pgls_pretty_print::nodes::create_trig_stmt::emit_create_trig_stmt (crates/pgls_pretty_print/src/nodes/create_trig_stmt.rs)
  • FunctionTooLong: pgls_pretty_print::nodes::grant_stmt::emit_grant_stmt (crates/pgls_pretty_print/src/nodes/grant_stmt.rs)
  • Members sharing a duplicated core (4 members, 50+ identical tokens) (crates/pgls_pretty_print/src/nodes/a_expr.rs)
  • Members sharing a duplicated core (5 members, 50+ identical tokens) (crates/pgls_pretty_print/src/nodes/aggref.rs)
  • Off-boarding risk: anonymized user #1
  • Off-boarding risk: anonymized user #2
  • TodoComment (crates/pgls_pretty_print/src/nodes/def_elem.rs)
  • pgls_pretty_print::nodes::create_stmt::emit_create_stmt (cognitive 97) (crates/pgls_pretty_print/src/nodes/create_stmt.rs)
  • pgls_pretty_print::nodes::create_stmt::emit_create_stmt (cyclomatic 45) (crates/pgls_pretty_print/src/nodes/create_stmt.rs)
  • pgls_pretty_print::nodes::create_trig_stmt::emit_create_trig_stmt (cognitive 25) (crates/pgls_pretty_print/src/nodes/create_trig_stmt.rs)
  • pgls_pretty_print::nodes::create_trig_stmt::emit_create_trig_stmt (cyclomatic 21) (crates/pgls_pretty_print/src/nodes/create_trig_stmt.rs)
  • pgls_pretty_print::nodes::grant_stmt::emit_grant_stmt (cognitive 26) (crates/pgls_pretty_print/src/nodes/grant_stmt.rs)
  • pgls_pretty_print::nodes::grant_stmt::emit_grant_stmt (cyclomatic 42) (crates/pgls_pretty_print/src/nodes/grant_stmt.rs)
  • pgls_pretty_print::normalize::normalize_join_expr (cognitive 29) (crates/pgls_pretty_print/src/normalize.rs)
  • …and 1 more

New (77)

  • Duplicate method signatures across three distinct Rules types. The logic for checking rule existence is identical, suggesting a shared trait or base struct could reduce code duplication.
  • Duplicate type definitions with identical signatures across different configuration sub-modules. While namespaced, RuleGroup is defined three times in pgls_configuration for linter, pglinter, and splinter, creating maintenance overhead and potential type mismatch issues if they diverge.
  • Duplicated block (11 lines × 2) (crates/pgls_pretty_print/src/nodes/alter_table_stmt.rs)
  • Duplicated block (11 lines × 2) (crates/pgls_pretty_print_codegen/src/proto_analyser.rs)
  • Duplicated block (11–12 lines × 2) (crates/pgls_pretty_print/src/renderer.rs)
  • Duplicated block (12 lines × 2) (crates/pgls_pretty_print/src/nodes/node_list.rs)
  • Duplicated block (12 lines × 3) (crates/pgls_configuration/src/format.rs)
  • Duplicated block (15 lines × 2) (crates/pgls_pretty_print/src/nodes/select_stmt.rs)
  • Duplicated block (8–10 lines × 4) (crates/pgls_pretty_print/src/nodes/alter_table_stmt.rs)
  • End-of-life runtime: Rust 1.88
  • FunctionTooLong: pgls_pretty_print::nodes::create_stmt::emit_create_stmt_impl (crates/pgls_pretty_print/src/nodes/create_stmt.rs)
  • FunctionTooLong: pgls_pretty_print::nodes::create_trig_stmt::emit_create_trig_stmt_impl (crates/pgls_pretty_print/src/nodes/create_trig_stmt.rs)
  • FunctionTooLong: pgls_pretty_print::nodes::grant_stmt::emit_grant_stmt_impl (crates/pgls_pretty_print/src/nodes/grant_stmt.rs)
  • FunctionTooLong: pgls_typecheck::diagnostics::create_type_error (crates/pgls_typecheck/src/diagnostics.rs)
  • Further orphaned files (smaller)
  • Hotspot: crates/pgls_pretty_print/src/nodes/select_stmt.rs (crates/pgls_pretty_print/src/nodes/select_stmt.rs)
  • Hotspot: crates/pgls_pretty_print/src/renderer.rs (crates/pgls_pretty_print/src/renderer.rs)
  • Inconsistent naming and scope between RuleFilter and AnalysisFilter. RuleFilter has match_group and match_rule, while AnalysisFilter has match_category, match_group, and match_rule. It is unclear if RuleFilter is a subset of AnalysisFilter or if they serve overlapping purposes in filtering logic.
  • Low cohesion: OsFileSystem (LCOM4 4) (crates/pgls_fs/src/fs/os.rs)
  • Low cohesion: SchemaCache (LCOM4 6) (crates/pgls_schema_cache/src/schema_cache.rs)
  • …and 57 more

Changes since last survey

  • 24 commits — 9 feature/other, 15 fixes

By area

  • crates/pgls_pretty_print — 13 commits
  • crates/pgls_statement_splitter — 2 commits
  • crates/pgls_workspace — 2 commits
  • .github/workflows — 1 commit
  • .sqlx/query-821669fc00fe4fcf0e1197eb874cf04332f80036419c8d054287b6f48fe6ce35.json — 1 commit
  • crates/pgls_cli — 1 commit
  • crates/pgls_configuration — 1 commit
  • crates/pgls_lexer — 1 commit
  • crates/pgls_lsp — 1 commit
  • crates/pgls_typecheck — 1 commit

Notable commits

  • fix: fix(ci): authenticate release version extraction (#814)
  • fix: fix(configuration): redact credentials in PartialDatabaseConfiguration debug output (#810)
  • fix: fix(diagnostics): prevent panics in indented multiline frames (#791)
  • fix: fix(pretty-print): fill long IN lists (#806)
  • fix: fix(pretty-print): keep window expressions compact (#813)
  • fix: fix(pretty-print): normalize WITH locations and ON TRUE joins in the generic pass (#801)
  • fix: fix(pretty-print): normalize associative boolean expressions before comparison (#802)
  • fix: fix(pretty-print): preserve PostgreSQL syntax in five printer edge cases (#799)
  • fix: fix(pretty-print): preserve multiline comments and grouped conditions (#808)
  • fix: fix(pretty-print): suppress child statement semicolons in CREATE SCHEMA (#803)
  • fix: fix(splitter): keep CTE queries attached to inserts (#792)
  • fix: fix(splitter): preserve blank lines in parsable SQL (#788)
  • fix: fix(splitter): support CTE column lists in CREATE ... AS (#804)
  • fix: fix(workspace): apply changed database credentials to cached connection pools (#811)
  • fix: fix: handle named parameters in identifier contexts (#790)
  • change: Make query compatible with postgres 19 (#783)
  • change: feat(format): add the castStyle option for :: versus CAST(...) (#798)
  • change: feat(format): add the clauseBodyStyle and isolateSemicolon options (#796)
  • change: feat(format): add the commaStyle and logicalOperatorPlacement options (#795)
  • change: feat(format): add the expanded statement layout (#797)
  • …and 4 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

supabase-community/postgres-language-server was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 30 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 653ecab137d77d7d44e7c57c7051759576cba05c — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-505904ce13c1.