Skip to content
PluginStats

prettier-plugin-postgresql weekly downloads statistics

By schallm (2 listings) · npm · Prettier plugins

Prettier plugin for PostgreSQL using the official libpg_query parser

View on npm Fresh · Oct 17, 2026

prettier-plugin-postgresql has 300 recorded weekly downloads on npm, an increase of 1665% over the past 30 days.

It ranks #1546 of 2,251 tracked npm listings by weekly downloads.

Over 90 days, weekly downloads changed by +97.4%.

PluginStats has 121 daily observations since Jun 19, 2026; the latest is from Oct 17, 2026.

Weekly downloads
300
Official API · Oct 17, 2026
7-day growth
+34.5%
+77 weekly downloads
30-day growth
+1665%
+283 weekly downloads
90-day growth
+97.4%
+148 weekly downloads
Rank
#1546
Among tracked npm listings

About prettier-plugin-postgresql

prettier-plugin-postgresql

Beta — covers the core PostgreSQL DML and DDL statement set. A number of uncommon top-level statements (e.g. CREATE CAST, ALTER DOMAIN, CREATE CONVERSION, CREATE STATISTICS, CREATE TEXT SEARCH …, CREATE OPERATOR CLASS, ALTER DEFAULT PRIVILEGES, CREATE / ALTER / DROP DATABASE, CREATE FOREIGN DATA WRAPPER) have no printer yet and are kept exactly as written (case and spacing included) instead. Inside a statement the formatter has a printer for, a construct it can't print raises an explicit Unsupported … error (for example a type modifier that is an expression, foo(1 + 1)) — it never silently drops or changes anything. The test suite enforces this by comparing the PostgreSQL parse tree before and after formatting.

A Prettier plugin for PostgreSQL SQL. Parses SQL with libpg_query (the actual PostgreSQL parser, from PostgreSQL 18) and formats it using Prettier's document IR for consistent, readable output.

Features

DML

• SELECT — column lists, table aliases, all JOIN types (INNER, LEFT, RIGHT, FULL, CROSS, NATURAL), WHERE, GROUP BY / HAVING, ORDER BY, LIMIT / OFFSET, FETCH FIRST … WITH TIES, DISTINCT, DISTINCT ON • Set operations — UNION / UNION ALL / INTERSECT / EXCEPT, with WITH / ORDER BY / LIMIT applying to the whole result, and operands parenthesized where they need to be • VALUES — standalone, with WITH, ORDER BY and LIMIT • Subqueries — correlated subqueries, EXISTS, scalar sublinks, ARRAY(subquery), row comparisons ((a, b) value), func(VARIADIC arr) • Ordered-set aggregates — percentile_cont(0.5) WITHIN GROUP (ORDER BY x) • Conditional — CASE / WHEN / THEN / ELSE, COALESCE, NULLIF, GREATEST, LEAST • XML functions — XMLELEMENT (with XMLATTRIBUTES), XMLFOREST, XMLCONCAT, XMLPI, XMLAGG, XMLEXISTS, IS DOCUMENT • XMLTABLE — tabular XML query in the FROM clause; XMLNAMESPACES, alias column lists, PASSING, COLUMNS with PATH, DEFAULT, NOT NULL, FOR ORDINALITY • SQL/JSON functions — JSON_QUERY, JSON_EXISTS, JSON_VALUE with FORMAT JSON, PASSING, RETURNING, WITH / WITHOUT WRAPPER, KEEP / OMIT QUOTES, and … ON EMPTY / … ON ERROR (including DEFAULT expr) — PostgreSQL 16+ • SQL/JSON constructors and predicates — x IS [NOT] JSON [VALUE | ARRAY | OBJECT | SCALAR] [WITH UNIQUE KEYS], JSON, JSON_SCALAR, JSON_SERIALIZE, JSON_OBJECT, JSON_ARRAY (also JSON_ARRAY(SELECT …)), JSON_OBJECTAGG, JSON_ARRAYAGG with FORMAT JSON values, ABSENT / NULL ON NULL, WITH UNIQUE KEYS, RETURNING, and aggregate ORDER BY / FILTER / OVER — PostgreSQL 16+ • JSON_TABLE — tabular JSON query in the FROM clause; PASSING, PATH, EXISTS PATH, FORMAT JSON PATH, NESTED PATH … AS name, FOR ORDINALITY, wrapper and quotes options, ON EMPTY/ON ERROR — PostgreSQL 16+ • Predicates — IN / NOT IN, BETWEEN / NOT BETWEEN, LIKE / NOT LIKE, ILIKE / NOT ILIKE, SIMILAR TO, IS NULL / IS NOT NULL, IS DISTINCT FROM, ANY / ALL • SQL value functions — CURRENT_DATE, CURRENT_TIMESTAMP, CURRENT_USER, SESSION_USER, LOCALTIME, LOCALTIMESTAMP, and others, with precision (CURRENT_TIMESTAMP(0)) • GROUPING() — GROUPING(col) predicate used alongside GROUPING SETS

DML (continued)

• SET / SHOW / RESET — SET search_path = myschema, SET TIME ZONE INTERVAL '1' HOUR TO MINUTE, SHOW work_mem, RESET ALL • ALTER SYSTEM — ALTER SYSTEM SET param = value, ALTER SYSTEM RESET [ALL] — writes to postgresql.conf • DISCARD — DISCARD ALL, DISCARD PLANS, DISCARD SEQUENCES, DISCARD TEMP • SELECT INTO — SELECT ... INTO [TEMP | UNLOGGED] table • COPY — COPY table FROM/TO, COPY (query) TO; program and option list • EXPLAIN — EXPLAIN, EXPLAIN ANALYZE, EXPLAIN (ANALYZE, VERBOSE, FORMAT JSON) stmt • PREPARE / EXECUTE / DEALLOCATE — server-side prepared statements • LISTEN / UNLISTEN / NOTIFY — async pub/sub with optional payload • LOCK TABLE — LOCK TABLE t IN ACCESS EXCLUSIVE MODE [NOWAIT] • Cursors — DECLARE CURSOR, FETCH, MOVE, CLOSE • Comment preservation — a script made only of comments is kept; line comments (-- ...) and block comments (/* ... */) are preserved: leading comments before a statement stay before it; inline trailing comments stay on the statement's final line • Meaning preserved — the test suite checks that formatting never changes what a statement means: every fixture's PostgreSQL parse tree must be the same before and after

DDL (continued)

• ALTER GROUP / ALTER LARGE OBJECT — ADD USER / DROP USER members, large object OIDs, OWNER TO current_user • ALTER FUNCTION — SET COST, SET ROWS, SET VOLATILE/STABLE/IMMUTABLE, RENAME TO, OWNER TO, SET SCHEMA • REFRESH MATERIALIZED VIEW — with CONCURRENTLY • CREATE RULE — BEFORE/AFTER/INSTEAD, INSERT/UPDATE/DELETE/SELECT, DO ALSO/INSTEAD • Row Security Policies — CREATE / ALTER POLICY with USING and WITH CHECK • REASSIGN OWNED — REASSIGN OWNED BY old_role TO new_role • DROP OWNED — DROP OWNED BY roles [CASCADE]

Pending Implementation

| Feature | Notes |

| PL/pgSQL | Full procedural language (IF/ELSIF, LOOP, RETURN, EXCEPTION, DECLARE) — out of scope for a SQL formatter |

Requirements

| Requirement | Version |

| Node.js | 20 or later | | .NET Runtime | 8.0 or later | | Prettier | 3.x |

Installation

Then add the plugin to your Prettier configuration:

See Getting Started for VS Code setup and build-from-source instructions.

Quick Example

Input (unformatted):

Output (default options — lowercase keywords, standard density, trailing commas):

Configuration

Three formatting options are available. See Options for full details and examples.

| Option | Values | Default | Description |

| sqlKeywordCase | lower \| upper \| preserve | lower | Case for SQL keywords | | sqlDensity | compact \| standard \| spacious | standard | Whitespace density | | sqlCommaStyle | trailing \| leading | trailing | Comma placement in lists |

Documentation

• Getting Started — installation, VS Code setup, building from source • Options — all formatting options with examples • Examples — before/after formatting examples for common patterns • Formatting Reference — comprehensive formatting rules by statement type

Description from the npm listing.

  • prettier
  • prettier-plugin
  • sql
  • postgresql
  • postgres
  • pgsql
  • formatter

Where prettier-plugin-postgresql sits in the listing

Each band is one page of 20. Weekly downloads on a log scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

All npm2,248 listings · 113 pages · page 78, #7 (overall #1547)
All npm: every listing in weekly downloads order
PNG SVG
Prettier plugins241 listings · 13 pages · page 2, #20 (overall #40)
Prettier plugins: every listing in weekly downloads order
PNG SVG

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

prettier-plugin-postgresql weekly downloads on npm, last 90 days: 300 weekly downloads as of Oct 17, 2026, +97.4% over 90 days.prettier-plugin-postgresqlWeekly downloads on npm · Last 90 days300downloads / week+97.4% over 90 days02004006008001KJul 19Aug 3Aug 18Sep 2Sep 17Oct 2Oct 17downloads / weekobservedarchived (Internet Archive)no observationsJul 20, 2026 – Oct 17, 2026 · 90 observations · Updated Oc…pluginstats.com
prettier-plugin-postgresql weekly downloads on npm, last 90 days: 300 weekly downloads as of Oct 17, 2026, +97.4% over 90 days.
PNG SVG

7/30/90-day growth

prettier-plugin-postgresql weekly downloads growth on npm: +34.5% over 7 days, +1665% over 30 days, +97.4% over 90 days.prettier-plugin-postgresqlWeekly downloads growth on npm300downloads / week now7-day growth+77 weekly downloads+34.5%30-day growth+283 weekly downloads+1665%90-day growth+148 weekly downloads+97.4%Growth vs. nearest observation to each baseline date · Updated Oct 17, 2026pluginstats.com
prettier-plugin-postgresql weekly downloads growth on npm: +34.5% over 7 days, +1665% over 30 days, +97.4% over 90 days.
PNG SVG

Ranking history

prettier-plugin-postgresql npm ranking history: currently #1546 (by weekly downloads).prettier-plugin-postgresqlnpm ranking · by weekly downloads · Last 90 days#1546current rank#1544#1545#1546#1547#1548Jul 20Aug 4Aug 19Sep 3Sep 18Oct 3Oct 18rankOct 18, 2026 – Oct 18, 2026 · 1 observations · Updated Oct 17, 2026pluginstats.com
prettier-plugin-postgresql npm ranking history: currently #1546 (by weekly downloads).
PNG SVG

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Recent observations

Full history (121)
Recent weekly downloads observations for prettier-plugin-postgresql
Date (UTC)Weekly downloadsChange vs. previous
300-5
305+143
162-4
166-12
1780
178+122
56-167
223-17
240-171
4110
411+4
407-15
422-35
457—

Similar npm Prettier plugins plugins

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/prettier-plugin-postgresql. First seen Oct 16, 2026; last successful collection Oct 18, 2026. See the methodology.