@jdg32794/prettier-plugin-pgsql weekly downloads statistics
By jdg32794 · npm · Prettier plugins
Prettier plugin for PostgreSQL, powered by the Rust pgsqlfmt formatter
@jdg32794/prettier-plugin-pgsql has 8 recorded weekly downloads on npm, a change of -92.4% over the past 7 days, ranking #2087 of 2,322 tracked listings.
About @jdg32794/prettier-plugin-pgsql
@jdg32794/prettier-plugin-pgsql
A Prettier plugin for PostgreSQL. Formatting is done by the Rust pgsqlfmt crate, compiled to a native Node addon with napi-rs.
-- before
select a,b from t where x=1;
-- after
SELECT
a,
b
FROM t
WHERE x = 1;
Install
npm install --save-dev prettier @jdg32794/prettier-plugin-pgsql
Requires Prettier 3.
Prerelease: the current
nextbuild (0.1.0-alpha.x) only includes a binary for macOS on Apple Silicon (arm64). Binaries for macOS x64, Linux x64 (glibc) and Windows x64 are planned for the first stable release.
Usage
Add the plugin to your Prettier config:
{
"plugins": ["@jdg32794/prettier-plugin-pgsql"]
}
Files ending in .sql, .pgsql and .psql are then formatted automatically:
npx prettier --write "**/*.sql"
To use the plugin for other files, set "parser": "postgresql" in an override.
Statements that pgsqlfmt cannot parse are left unchanged.
Options
| Option | Default | Description |
|---|---|---|
pgKeywordCase | "upper" | Case of SQL keywords: "upper", "lower" or "preserve". |
pgCommaStyle | "trailing" | Comma position when items go one per line: "trailing" or "leading". |
Prettier's own printWidth and tabWidth are respected (tabWidth minimum 2).
{
"plugins": ["@jdg32794/prettier-plugin-pgsql"],
"pgKeywordCase": "lower",
"pgCommaStyle": "leading"
}
Using the formatter directly
The native binding can also be used without Prettier:
const { formatSql } = require('@jdg32794/prettier-plugin-pgsql/index.js')
formatSql('select 1', { maxWidth: 80, indentWidth: 2, keywordCase: 'upper', commaStyle: 'trailing' })
Development
Requires a recent Rust toolchain and Node.js.
yarn install
yarn build # builds prettier-plugin-pgsql.<platform>.node
yarn test
License
MIT
Description from the npm listing.
- prettier
- prettier-plugin
- postgresql
- postgres
- pgsql
- sql
- formatter
- napi-rs
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
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.
Each band is one page of 20. Weekly downloads on a linear 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.
Recent observations
Full history (122)Similar npm Prettier plugins plugins
All 20 @jdg32794/prettier-plugin-pgsql alternativesData 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/@jdg32794/prettier-plugin-pgsql. First seen Oct 16, 2026; last successful collection Oct 20, 2026. See the methodology.