pgfence is a source-available CLI that catches dangerous Postgres migrations in your CI/CD pipeline. Unlike existing tools in Ruby or Go, it is natively built for the Node.js ecosystem (Prisma, TypeORM, Drizzle, Sequelize). It analyzes DDL to predict precise locking behaviors (like ACCESS EXCLUSIVE), flags risks, and generates the exact zero-downtime rewrite recipes you need. Stop shipping DB downtime masked as harmless schema changes.see more
Founder
Screenshots





About
Imagine the sinking feeling when a seemingly routine database migration causes unexpected downtime in your live production environment. That fear, the late-night emergency calls, and the frantic scramble to roll back a change—it's a scenario every modern developer dreads, especially when dealing with PostgreSQL. That's exactly where pgfence steps in as your essential safety net. This isn't just another static analysis tool; it’s a purpose-built command line interface designed specifically to integrate seamlessly into your existing CI/CD workflow, acting as the final, intelligent gatekeeper before your database changes ever touch production. We understand that in the fast-paced world of Node.js development, you rely on modern ORMs like Prisma, TypeORM, Drizzle, and Sequelize. pgfence speaks their language fluently, deeply analyzing the Data Definition Language (DDL) generated by these frameworks to predict exactly how your schema changes will behave under real-world load. It goes far beyond simple syntax checks by simulating the locking behavior of your proposed alterations, specifically flagging those insidious risks like ACCESS EXCLUSIVE locks that can freeze your application and halt customer access without warning.
What truly sets pgfence apart is its proactive, solution-oriented approach. It doesn't just tell you that you have a problem; it provides the blueprint for fixing it before the problem even materializes. When pgfence detects a high-risk migration—perhaps an operation that requires a table lock that will inevitably lead to downtime—it doesn't leave you guessing. Instead, it generates precise, actionable, zero-downtime rewrite recipes tailored to your specific database operation. This means you receive clear instructions on how to restructure your migration script to achieve the same outcome without incurring the dreaded production freeze. Think of it as having an expert PostgreSQL DBA reviewing every single schema change in real time, ensuring that what looks like a harmless update on your local machine translates into a smooth, non-blocking deployment in production. This level of foresight transforms database management from a source of anxiety into a predictable, reliable part of your deployment pipeline.
By adopting pgfence, you are fundamentally shifting your team's focus from reactive firefighting to proactive engineering. Integrating this source-available CLI into your GitHub workflows means that every pull request containing database changes is automatically vetted for potential downtime risks. This builds incredible confidence across your engineering organization. Your developers can iterate faster, knowing that the guardrails are firmly in place, and your operations team can sleep soundly, confident that schema updates won't be the source of the next major incident. Stop masking dangerous database behavior as simple schema changes; start shipping reliable, high-performance applications powered by truly safe PostgreSQL migrations, all thanks to the deep, ecosystem-aware analysis provided by pgfence.