
Company News
Socket Partners with Replit to Block Malicious Packages in AI-Powered Development
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.
A modern CLI for modular PostgreSQL development.
pgpm is a focused command-line tool for PostgreSQL database migrations and package management. It provides the core functionality for managing database schemas, migrations, and module dependencies.
pgpm init delivers a ready-to-code Postgres workspace with CI/CD, Docker, end-to-end testing, and modern TS tooling.# Install pgpm globally
npm install -g pgpm
# Start local Postgres (via Docker) and export env vars
pgpm docker start
eval "$(pgpm env)"
Tip: Already running Postgres? Skip the Docker step and just export your PG* vars.
# 1. Create a workspace
pgpm init workspace
cd my-app
# 2. Create your first module
pgpm init
cd packages/your-module
# 3. Install a package
pgpm install @pgpm/faker
# 4. Deploy everything
pgpm deploy --createdb --database mydb1
psql -d mydb1 -c "SELECT faker.city('MI');"
> Ann Arbor
Here are some useful commands for reference:
pgpm init - Initialize a new modulepgpm init workspace - Initialize a new workspacepgpm init --template <path> - Initialize using a full template path (e.g., pnpm/module)pgpm init -w - Create a workspace first, then create the module inside itpgpm docker start - Start PostgreSQL container (via Docker)pgpm docker stop - Stop PostgreSQL containerpgpm env - Print PostgreSQL environment variables for shell exportpgpm deploy - Deploy database changes and migrationspgpm verify - Verify database state matches expected migrationspgpm revert - Safely revert database changespgpm migrate - Comprehensive migration managementpgpm migrate init - Initialize migration trackingpgpm migrate status - Check migration statuspgpm migrate list - List all changespgpm migrate deps - Show change dependenciespgpm install - Install database modules as dependenciespgpm upgrade-modules - Upgrade installed modules to latest versionspgpm extension - Interactively manage module dependenciespgpm tag - Version your changes with tagspgpm plan - Generate deployment plans for your modulespgpm package - Package your module for distributionpgpm test-packages - Run integration tests on all modules in a workspacepgpm add - Add a new database changepgpm remove - Remove a database changepgpm export - Export migrations from existing databasespgpm clear - Clear database statepgpm kill - Clean up database connectionspgpm analyze - Analyze database structurepgpm rename - Rename database changespgpm admin-users - Manage admin userspgpm cache clean - Clear cached template repos used by pgpm initpgpm update - Install the latest pgpm version from npm# 1. Create workspace
pgpm init workspace
cd my-app
# 2. Create your first module
pgpm init
cd packages/new-module
# 3. Add some SQL migrations to sql/ directory
pgpm add some_change
# 4. Deploy to database
pgpm deploy --createdb
pgpm init now scaffolds workspaces/modules from https://github.com/constructive-io/pgpm-boilerplates.git using create-gen-app with a one-week cache (stored under ~/.pgpm/cache/repos). Override with --repo, --from-branch, and --template, or use a local template path.pgpm cache clean to wipe the cached boilerplates if you need a fresh pull.PGPM_SKIP_UPDATE_CHECK is set). Use pgpm update to upgrade to the latest release.# 1. Navigate to your module
cd packages/your-module
# 2. Install a package
pgpm install @pgpm/faker
# 3. Deploy all installed modules
pgpm deploy --createdb --database mydb1
psql -d mydb1 -c "SELECT faker.city('MI');"
> Ann Arbor
# 1. Install workspace dependencies
pnpm install
# 2. Enter the packages/<yourmodule>
cd packages/yourmodule
# 3. Test the module in watch mode
pnpm test:watch
pgpm deployDeploy your database changes and migrations.
# Deploy to selected database
pgpm deploy
# Create database if it doesn't exist
pgpm deploy --createdb
# Deploy specific package to a tag
pgpm deploy --package mypackage --to @v1.0.0
# Fast deployment without transactions
pgpm deploy --fast --no-tx
pgpm verifyVerify your database state matches expected migrations.
# Verify current state
pgpm verify
# Verify specific package
pgpm verify --package mypackage
pgpm revertSafely revert database changes.
# Revert latest changes
pgpm revert
# Revert to specific tag
pgpm revert --to @v1.0.0
pgpm migrateComprehensive migration management.
# Initialize migration tracking
pgpm migrate init
# Check migration status
pgpm migrate status
# List all changes
pgpm migrate list
# Show change dependencies
pgpm migrate deps
pgpm installInstall pgpm modules as dependencies.
# Install single package
pgpm install @pgpm/base32
# Install multiple packages
pgpm install @pgpm/base32 @pgpm/faker
pgpm upgrade-modulesUpgrade installed pgpm modules to their latest versions from npm.
# Interactive selection of modules to upgrade
pgpm upgrade-modules
# Upgrade all installed modules without prompting
pgpm upgrade-modules --all
# Preview available upgrades without making changes
pgpm upgrade-modules --dry-run
# Upgrade specific modules
pgpm upgrade-modules --modules @pgpm/base32,@pgpm/faker
# Upgrade modules across all packages in the workspace
pgpm upgrade-modules --workspace --all
Options:
--all - Upgrade all modules without prompting--dry-run - Show what would be upgraded without making changes--modules <names> - Comma-separated list of specific modules to upgrade--workspace - Upgrade modules across all packages in the workspace--cwd <directory> - Working directory (default: current directory)pgpm extensionInteractively manage module dependencies.
pgpm extension
pgpm tagVersion your changes with tags.
# Tag latest change
pgpm tag v1.0.0
# Tag with comment
pgpm tag v1.0.0 --comment "Initial release"
# Tag specific change
pgpm tag v1.1.0 --package mypackage --changeName my-change
pgpm planGenerate deployment plans for your modules.
pgpm plan
pgpm packagePackage your module for distribution.
# Package with defaults
pgpm package
# Package without deployment plan
pgpm package --no-plan
pgpm dumpDump a postgres database to a sql file.
# dump to default timestamped file
pgpm dump --database mydb
# interactive mode (prompts for database)
pgpm dump
# dump to specific file
pgpm dump --database mydb --out ./backup.sql
# dump from a specific working directory
pgpm dump --database mydb --cwd ./packages/my-module
# dump with pruning
# useful for creating test fixtures or development snapshots
pgpm dump --database mydb --database-id <uuid>
pgpm exportExport migrations from existing databases.
pgpm export
pgpm killClean up database connections and optionally drop databases.
# Kill connections and drop databases
pgpm kill
# Only kill connections
pgpm kill --no-drop
pgpm test-packagesRun integration tests on all modules in a workspace. Creates a temporary database for each module, deploys, and optionally runs verify/revert/deploy cycles.
# Test all modules in workspace (deploy only)
pgpm test-packages
# Run full deploy/verify/revert/deploy cycle
pgpm test-packages --full-cycle
# Continue testing all packages even after failures
pgpm test-packages --continue-on-fail
# Exclude specific modules
pgpm test-packages --exclude my-module,another-module
# Combine options
pgpm test-packages --full-cycle --continue-on-fail --exclude legacy-module
Options:
--full-cycle - Run full deploy/verify/revert/deploy cycle (default: deploy only)--continue-on-fail - Continue testing all packages even after failures (default: stop on first failure)--exclude <modules> - Comma-separated module names to exclude--cwd <directory> - Working directory (default: current directory)Notes:
pgpm.json configurationtest_<module_name>) for each modulepgpm uses standard PostgreSQL environment variables (PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD).
Quick setup (recommended):
eval "$(pgpm env)"
Manual setup (if you prefer):
export PGHOST=localhost
export PGPORT=5432
export PGDATABASE=myapp
export PGUSER=postgres
export PGPASSWORD=password
Supabase local development:
eval "$(pgpm env --supabase)"
# Global help
pgpm --help
# Command-specific help
pgpm deploy --help
pgpm tag -h
Most commands support these global options:
--help, -h - Show help information--version, -v - Show version information--cwd <dir> - Set working directoryInstall the pgpm skill for AI coding agents (Devin, Claude Code, Cursor, Copilot):
npx skills add https://github.com/constructive-io/constructive --skill pgpm
For the full Constructive platform skills (security, blueprints, codegen, billing, etc.):
npx skills add constructive-io/constructive-skills
π Quickstart: Getting Up and Running Get started with modular databases in minutes. Install prerequisites and deploy your first module.
π¦ Modular PostgreSQL Development with Database Packages Learn to organize PostgreSQL projects with pgpm workspaces and reusable database modules.
βοΈ Authoring Database Changes Master the workflow for adding, organizing, and managing database changes with pgpm.
π§ͺ End-to-End PostgreSQL Testing with TypeScript Master end-to-end PostgreSQL testing with ephemeral databases, RLS testing, and CI/CD automation.
β‘ Supabase Testing Use TypeScript-first tools to test Supabase projects with realistic RLS, policies, and auth contexts.
π§ Drizzle ORM Testing Run full-stack tests with Drizzle ORM, including database setup, teardown, and RLS enforcement.
π§ Troubleshooting Common issues and solutions for pgpm, PostgreSQL, and testing.
SET LOCAL) into queriesβideal for setting role, jwt.claims, and other session settings.libpg_query, converting SQL into parse trees.Install skills for AI coding agents:
# All platform skills (security, blueprints, codegen, billing, etc.)
npx skills add constructive-io/constructive-skills
# Individual repo skills (pgpm, testing, CLI, search, etc.)
npx skills add https://github.com/constructive-io/constructive --skill pgpm
npx skills add https://github.com/constructive-io/constructive --skill constructive-testing
π Built by the Constructive team β creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on GitHub.
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
No developer or entity involved in creating this software will be liable for any claims or damages whatsoever associated with your use, inability to use, or your interaction with other users of the code, including any direct, indirect, incidental, special, exemplary, punitive or consequential damages, or loss of profits, cryptocurrencies, tokens, or anything else of value.
FAQs
PostgreSQL Package Manager - Database migration and package management CLI
The npm package pgpm receives a total of 969 weekly downloads. As such, pgpm popularity was classified as not popular.
We found that pgpm demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Replit is integrating Socket Firewall into its AI-powered development experience to help protect builders from malicious open source packages.

Security News
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.

Research
/Security News
Newer packages in this compromise use native extensions and .pth loaders to execute JavaScript stealers in developer environments.