Postgrator
Reasonable, with limits. 5th of 7 database migration tools.
Postgrator is a small, mature Node.js library that runs numbered plain-SQL (or JS) migration files on PostgreSQL, MySQL, SQL Server and SQLite. It is reliable and simple, but it is maintained by one person at a slow pace and does less than node-pg-migrate or dbmate, so it is a reasonable choice rather than a first pick.
Best for: Developers who want to embed a minimal plain-SQL migration runner in a Node app and bring their own database driver.
Scores
Overall5.5
How strongly do we recommend it for a new project today?
Claude Opus 5.5: 5.0, likely 4.0 to 6.0
Postgrator is a dependable, minimal plain-SQL migration runner with a clean safety record and multi-database support. Maintenance by one person is slow, it lacks features peers have, and it is losing share while node-pg-migrate and dbmate grow fast. It suits embedding, as in Platformatic, but most new projects are better served by a more active peer.
- peers node-pg-migrate: 260 commits last year and 11.6x download growth
- peers dbmate: 7.5k stars, active, plain-SQL, any language
- github.com/rickbergfalk/postgrator/blob/master/CHANGELOG.md: Slow release cadence
GPT-6.2 Sol: 6.0, likely 4.8 to 7.2
Postgrator is a reasonable new choice when a Node.js team wants plain SQL, checksum checks, and control of the database connection. Its sparse release history and separate migration and history writes make it harder to recommend as the category default. Dbmate is stronger for teams that want a standalone SQL CLI and transactional migrations, while node-pg-migrate offers built-in locking for PostgreSQL. The range reflects how much the choice depends on the deployment setup and whether the renewed maintenance continues.
- raw.githubusercontent.com/rickbergfalk/postgrator/v8.0.1/postgrator.js: Confirms the core SQL workflow and separate migration and history calls.
- raw.githubusercontent.com/rickbergfalk/postgrator/master/CHANGELOG.md: Shows a recent dependency patch after a long gap and work on the next major version.
- github.com/amacneil/dbmate: Documents a standalone SQL CLI and transactional migrations where supported.
- salsita.github.io/node-pg-migrate/api: Documents the PostgreSQL runner's advisory lock and transaction options.
Needed by many5.7
How many developers need a tool for this job?
Claude Opus 5.5: 6.0, likely 5.0 to 7.0
Most backend projects with a SQL database need migrations. Postgrator covers four SQL engines rather than one, which keeps its potential audience broad. Its plain-SQL, library-first approach suits a sizeable group, though not ORM users who already get migrations from their ORM.
- github description: PostgreSQL, MySQL and SQL Server with plain SQL scripts
- github.com/rickbergfalk/postgrator: README lists pg, mysql, mssql and sqlite3 drivers
GPT-6.2 Sol: 5.4, likely 4.2 to 6.6
Schema migrations are common in database-backed applications, and Postgrator covers four widely used SQL engines. Its fit is narrower because it is a Node.js library for teams that maintain SQL files and supply their own database client. The survey measures database use across developers, so the share of JavaScript and TypeScript projects that want this workflow is an estimate.
- survey.stackoverflow.co/2026/technology/data/databases: PostgreSQL, SQLite, MySQL, and SQL Server all rank among the most-used databases.
- raw.githubusercontent.com/rickbergfalk/postgrator/v8.0.1/README.md: Documents four engines, plain SQL files, and caller-provided query execution.
- raw.githubusercontent.com/rickbergfalk/postgrator/v8.0.1/package.json: The stable package declares Node.js 20 or later.
Helps a lot6.0
How well does it do the job for those who need it?
Claude Opus 5.5: 5.5, likely 4.5 to 6.5
Postgrator does the core job well: versioned do/undo files, checksum validation, async JS migrations, events, and migrating up or down to a target version. It is minimal, though. The library has no CLI of its own, no generator, no schema DSL, and no rollback of a whole failed batch. node-pg-migrate and dbmate offer more for most users. The API is small, which makes it easy for AI agents to write correct code for it.
- github.com/rickbergfalk/postgrator: Feature set, and failed batches leave earlier migrations applied
- github.com/rickbergfalk/postgrator/blob/master/CHANGELOG.md: Steady small additions: sqlite, better-sqlite3, execSqlScript
- npm hasTypes: Ships TypeScript types
GPT-6.2 Sol: 6.4, likely 5.3 to 7.5
Version 8.0.1 runs SQL up and down to a target version, verifies applied SQL checksums, and reports which steps completed before an error. It runs each script and records it in separate calls, so a history write failure can leave the schema ahead of the recorded version. The shipped types help with integration, though the README's broken pg example can mislead developers and coding agents. Current code confirms the main behavior, while independent performance and agent coding measurements are sparse.
- raw.githubusercontent.com/rickbergfalk/postgrator/v8.0.1/postgrator.js: Shows target selection, checksum checks, separate history writes, and partial failure reporting.
- raw.githubusercontent.com/rickbergfalk/postgrator/v8.0.1/postgrator.d.ts: Ships declarations for drivers, migrations, and events.
- github.com/rickbergfalk/postgrator/issues/110: A PostgreSQL user reports an applied change after a failed history write.
- github.com/rickbergfalk/postgrator/issues/173: A user reports that the documented pg client method is missing.
- github.com/guidesmiths/marv#what-makes-marv-special: An older comparison included Postgrator and treated cluster safety as a selection criterion.
Holds up over time5.0
Will it still be a good choice in two years?
Claude Opus 5.5: 5.0, likely 3.5 to 6.5
The project has been alive since 2012 and still gets fixes. 8.0.1 came out in November 2026, and a TypeScript v9 is in progress. There were only 14 commits and one release in the year, it rests mainly on one maintainer, and it has no known funding. Breaking changes are rare and well documented.
- github commitsLastYear: 14 commits in the last year
- npm versionsLastYear: One release in the last year
- github.com/rickbergfalk/postgrator/blob/master/CHANGELOG.md: 8.0.0 in Nov 2024 and 8.0.1 in Nov 2026; v9 TypeScript rewrite unreleased
- scorecard Maintained: Maintained check scores 5/10
GPT-6.2 Sol: 4.9, likely 3.5 to 6.3
The project made 14 commits and published one npm patch in the last year, following a roughly two-year release gap. The changelog shows work on version 9, including a TypeScript rewrite, a higher Node.js minimum, and breaking type changes. The Windows glob report is still open, and both dbmate and node-pg-migrate had substantially more commits. The next release and the project's ability to sustain a faster maintenance pace are uncertain.
- evidence.github.commitsLastYear and evidence.npm.versionsLastYear: 14 commits and one npm version in the last year.
- raw.githubusercontent.com/rickbergfalk/postgrator/master/CHANGELOG.md: Dates versions 8.0.0 and 8.0.1 and lists changes planned for version 9.
- github.com/rickbergfalk/postgrator/issues/172: Windows file discovery issue opened in February 2025 is still open.
- peers dbmate and node-pg-migrate commitsLastYear: dbmate had 139 commits and node-pg-migrate had 260.
Used widely4.1
How many use it, and is that growing?
Claude Opus 5.5: 4.5, likely 3.5 to 5.5
It has about 329k downloads per 4 weeks and 3,053 dependent repos, which is more dependent repos than db-migrate. Some of those downloads come through Platformatic rather than direct choice. Its growth ratio of 2.3x is well below the 4.1 median, so it is losing share, while node-pg-migrate (11.6x) and dbmate (15.7x) gain fast.
- npm downloadsLast4Weeks: 328,828 now vs 144,291 a year ago, a 2.3x ratio
- dependents repos: 3,053 repos, mid-pack among peers
- medianDownloadsRatio: Median is 4.1, so Postgrator is losing ground
- docs.platformatic.dev/docs/reference/db/migrations: Platformatic DB installs it, which inflates downloads
GPT-6.2 Sol: 3.6, likely 2.6 to 4.8
ecosyste.ms found 3,053 dependent repositories, slightly ahead of db-migrate and well behind Umzug. Four-week downloads rose from 144,291 to 328,828, or 2.28 times, below the 4.1 times baseline and well behind growth at dbmate and node-pg-migrate. The project has 466 GitHub stars and no matched Hacker News stories or Bluesky posts in the bundle. Automated builds, installs through the companion CLI, and partial repository coverage make direct adoption hard to pin down.
- evidence.dependents: ecosyste.ms found 3,053 repositories and 28 packages.
- evidence.npm.downloadsLast4Weeks, evidence.npm.downloadsSame4WeeksYearAgo, and medianDownloadsRatio: Downloads grew 2.28 times against the catalog median of 4.1 times.
- peers: Umzug leads in tracked dependent repositories, while dbmate and node-pg-migrate grew much faster.
- evidence.github.stars, evidence.hackerNews.stories, and evidence.bluesky.posts: 466 stars and zero matched stories or posts.
- github.com/MattiLehtinen/postgrator-cli/blob/master/package.json: The separately distributed CLI installs Postgrator as a dependency.
Vouched for4.4
Who stands behind it being good?
Claude Opus 5.5: 4.0, likely 3.0 to 5.5
Platformatic DB builds its migrations on Postgrator, which is a real, current production backer. Beyond that I found no surveys, benchmarks, Hacker News stories or Bluesky posts. Independent write-ups are mostly brief comparisons.
- docs.platformatic.dev/docs/db/migrations: Platformatic DB uses Postgrator for migrations
- hackerNews stories: No HN stories
- bluesky posts: No Bluesky posts
- npm-compare.com/node-pg-migrate,postgres-migrations: Comparison sites focus on node-pg-migrate, not Postgrator
GPT-6.2 Sol: 4.8, likely 3.4 to 6.3
Fastify uses Postgrator in its database guide, and cheminfo-sqlite builds on version 8 with its own migration locking. A Kysely community user reports choosing it to keep direct control of SQL, while Nearform's documented use comes from the now-archived Udaru project. Current production case studies and tool-specific satisfaction data are sparse, which keeps the range wide.
- fastify.dev/docs/v5.12.x/Guides/Database/#postgrator: Fastify documents Postgrator as a migration example.
- github.com/cheminfo/cheminfo-sqlite: The SQLite wrapper uses Postgrator 8 as a peer dependency.
- answeroverflow.com/m/1207255256321495150: A developer reports using Postgrator to control the SQL in migration files.
- github.com/nearform/udaru: Nearform documents use for migrations in an archived project.
Safe6.6
How safe is it to depend on?
Claude Opus 5.5: 7.0, likely 6.0 to 8.0
It has no advisories ever, a single dependency, an MIT licence, and you supply the database driver yourself, so the attack surface is small. The OpenSSF Scorecard is weak at 4.5: it scores 0 on branch protection, security policy, pinned dependencies and SAST, and low on code review. Publishing rests on one person.
- advisories total: No known advisories
- npm dependencies: One runtime dependency
- scorecard score: 4.5, with several checks at 0
- npm license: MIT
GPT-6.2 Sol: 6.1, likely 4.9 to 7.4
Version 8.0.1 uses the permissive MIT license and has one direct runtime dependency, glob. OSV and Snyk list no direct advisories, which leaves little evidence on how quickly the project handles disclosures. The 4.5 OpenSSF Scorecard shows strong workflow token permissions alongside weak code review, unpinned workflow dependencies, and missing branch protection and security policy checks. Snyk lists two maintainers, while release signing and who can publish remain unclear.
- raw.githubusercontent.com/rickbergfalk/postgrator/v8.0.1/package.json: The release declares MIT and one runtime dependency, glob.
- evidence.advisories: OSV found zero advisories for Postgrator.
- evidence.scorecard: Score of 4.5, with weak review and repository controls and inconclusive packaging and signing checks.
- security.snyk.io/package/npm/postgrator: Lists two maintainers and no reported direct vulnerabilities.
Good
- Migrations are plain numbered SQL files with optional undo files, and it checks md5 checksums of files that already ran.
- One API covers PostgreSQL, MySQL, SQL Server, SQLite and better-sqlite3, and you pass in your own execQuery function.
- It has a single runtime dependency (glob), ships types, and has no known advisories.
- Platformatic DB builds its migrations on it, which keeps it in real production use.
Bad
- It has one main maintainer and a slow pace: one npm release in the last year, and the TypeScript rewrite (v9) is still unreleased.
- A failed batch is not rolled back as a whole. Earlier migrations stay applied, and on SQL Server the GO separator can leave partial changes.
- The library has no built-in CLI, migration generator, schema builder or locking features. The CLI is a separate, third-party package.
- Downloads are growing more slowly than the median and much more slowly than node-pg-migrate and dbmate.
The numbers
- npm downloads, 4 weeks
- 329k ×2.3 in a year
- GitHub stars
- 466
- Commits, 12 months
- 14
- npm version
- 8.0.1 Nov 2026
- Versions, 12 months
- 1
- Advisories, 24 months
- 0 of 0 ever
- OpenSSF Scorecard
- 4.5 out of 10, Nov 2026
- Licence
- MIT
Read on 21 November 2026 from GitHub (rickbergfalk/postgrator), npm (postgrator), OSV and the OpenSSF Scorecard.