
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
create-pg-app
Advanced tools
Scaffold a fully-configured Postgres app in seconds with modules, migrations, testing, and workspace
A modern CLI for modular PostgreSQL development.
create-pg-app Scaffold a fully-configured Postgres app in seconds with modules, migrations, testing, and workspace setup.
create-pg-app init delivers a ready-to-code Postgres workspace with CI/CD, Docker, end-to-end testing, and modern TS tooling.# Install create-pg-app globally
npm install -g create-pg-app
# Start local Postgres (via Docker) and export env vars
create-pg-app docker start
eval "$(create-pg-app env)"
Tip: Already running Postgres? Skip the Docker step and just export your PG* vars.
# 1. Create a workspace
create-pg-app init --workspace
cd my-app
# 2. Create your first module
create-pg-app init
cd packages/your-module
# 3. Install a package
create-pg-app install @pgpm/faker
# 4. Deploy everything
create-pg-app deploy --createdb --database mydb1
psql -d mydb1 -c "SELECT faker.city('MI');"
> Ann Arbor
create-pg-app init - Initialize a new modulecreate-pg-app init --workspace - Initialize a new workspacecreate-pg-app docker start - Start PostgreSQL container (via Docker)create-pg-app docker stop - Stop PostgreSQL containercreate-pg-app env - Print PostgreSQL environment variables for shell exportcreate-pg-app deploy - Deploy database changes and migrationscreate-pg-app verify - Verify database state matches expected migrationscreate-pg-app revert - Safely revert database changescreate-pg-app migrate - Comprehensive migration managementcreate-pg-app migrate init - Initialize migration trackingcreate-pg-app migrate status - Check migration statuscreate-pg-app migrate list - List all changescreate-pg-app migrate deps - Show change dependenciescreate-pg-app install - Install database modules as dependenciescreate-pg-app extension - Interactively manage module dependenciescreate-pg-app tag - Version your changes with tagscreate-pg-app plan - Generate deployment plans for your modulescreate-pg-app package - Package your module for distributioncreate-pg-app add - Add a new database changecreate-pg-app remove - Remove a database changecreate-pg-app export - Export migrations from existing databasescreate-pg-app clear - Clear database statecreate-pg-app kill - Clean up database connectionscreate-pg-app analyze - Analyze database structurecreate-pg-app rename - Rename database changescreate-pg-app admin-users - Manage admin users# 1. Create workspace
create-pg-app init --workspace
cd my-app
# 2. Create your first module
create-pg-app init
cd packages/new-module
# 3. Add some SQL migrations to sql/ directory
create-pg-app add some_change
# 4. Deploy to database
create-pg-app deploy --createdb
# 1. Navigate to your module
cd packages/your-module
# 2. Install a package
create-pg-app install @pgpm/faker
# 3. Deploy all installed modules
create-pg-app 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
create-pg-app deployDeploy your database changes and migrations.
# Deploy to selected database
create-pg-app deploy
# Create database if it doesn't exist
create-pg-app deploy --createdb
# Deploy specific package to a tag
create-pg-app deploy --package mypackage --to @v1.0.0
# Fast deployment without transactions
create-pg-app deploy --fast --no-tx
create-pg-app verifyVerify your database state matches expected migrations.
# Verify current state
create-pg-app verify
# Verify specific package
create-pg-app verify --package mypackage
create-pg-app revertSafely revert database changes.
# Revert latest changes
create-pg-app revert
# Revert to specific tag
create-pg-app revert --to @v1.0.0
create-pg-app migrateComprehensive migration management.
# Initialize migration tracking
create-pg-app migrate init
# Check migration status
create-pg-app migrate status
# List all changes
create-pg-app migrate list
# Show change dependencies
create-pg-app migrate deps
create-pg-app installInstall create-pg-app modules as dependencies.
# Install single package
create-pg-app install @pgpm/base32
# Install multiple packages
create-pg-app install @pgpm/base32 @pgpm/faker
create-pg-app extensionInteractively manage module dependencies.
create-pg-app extension
create-pg-app tagVersion your changes with tags.
# Tag latest change
create-pg-app tag v1.0.0
# Tag with comment
create-pg-app tag v1.0.0 --comment "Initial release"
# Tag specific change
create-pg-app tag v1.1.0 --package mypackage --changeName my-change
create-pg-app planGenerate deployment plans for your modules.
create-pg-app plan
create-pg-app packagePackage your module for distribution.
# Package with defaults
create-pg-app package
# Package without deployment plan
create-pg-app package --no-plan
create-pg-app exportExport migrations from existing databases.
create-pg-app export
create-pg-app killClean up database connections and optionally drop databases.
# Kill connections and drop databases
create-pg-app kill
# Only kill connections
create-pg-app kill --no-drop
pgpm uses standard PostgreSQL environment variables (PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD).
Quick setup (recommended):
eval "$(create-pg-app 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 "$(create-pg-app env --supabase)"
# Global help
create-pg-app --help
# Command-specific help
create-pg-app deploy --help
create-pg-app tag -h
Most commands support these global options:
--help, -h - Show help information--version, -v - Show version information--cwd <dir> - Set working directorySET LOCAL) into queries—ideal for setting role, jwt.claims, and other session settings.libpg_query, converting SQL into parse trees.SELECT, INSERT, UPDATE, DELETE, and stored procedure calls—supports advanced SQL features like JOIN, GROUP BY, and schema-qualified queries.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
Scaffold a fully-configured Postgres app in seconds with modules, migrations, testing, and workspace
The npm package create-pg-app receives a total of 2 weekly downloads. As such, create-pg-app popularity was classified as not popular.
We found that create-pg-app demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.