Registry / database / create-pg

create-pg

JSON →
library1.2.1jsnpmunverified

create-pg (v1.2.1) is a CLI tool by Prisma that creates a temporary Prisma Postgres database with a single command. It supports both npm and npx usage, automatically generating a connection string and optional .env file. The database can be claimed and persisted in a Prisma Data Platform project. Updates are infrequent, and it's designed for rapid prototyping and CI environments where ephemeral databases are useful.

npm install create-pg
INSTALL
IMPORT
SIG · CREATE-PG
C
create-pg
databasejavascriptv1.2.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

create-pg
npx create-pg
npm install -g create-pg && create-pg
Use npx to avoid global install; the package is a CLI, not a library.

Shows how to instantly create a temporary Prisma Postgres database using npx.

npx create-pg@1.2.1 # Interactive: choose temporary or claim database. # For scripting: npx create-pg --temp # Outputs: DATABASE_URL='postgresql://...'
Debug
Known issues
gotchaThe temporary database is deleted after 24 hours if not claimed. Data loss can occur.
fix
Use the claim command (create-pg claim) to persist the database in your Prisma Data Platform project before the expiration.
affects: >=1.0.0
gotchaRequires a Prisma Data Platform account and authentication (prisma login) for claiming.
fix
Run 'npx prisma login' before claiming, or use the --temp flag to skip claiming.
affects: >=1.0.0
gotchaThe tool creates a Postgres database, not a file. It requires network access to Prisma's servers.
fix
Ensure internet connectivity and no firewall blocking api.prisma.cloud.
affects: >=1.0.0
gotchaThe generated DATABASE_URL may contain sensitive credentials. Avoid committing it to version control.
fix
Use environment variables or .env files and add them to .gitignore.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module './create-pg'
Running the wrong command (e.g., node create-pg instead of npx create-pg).
fix
Use 'npx create-pg' instead of node or npm start.
Error: Unauthorized: You must be logged in to Prisma Data Platform.
Attempting to claim a database without authentication.
fix
Run 'npx prisma login' first and follow the prompts to log in.
Error: Database creation failed: Connection timeout.
Network issues or Prisma Cloud service disruption.
fix
Check your internet connection and try again later. Use 'npx create-pg --temp' for a temporary database as a fallback.
Upgrade
Version history
1.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
6
OpenAI (training)
1
Resources
create-pg — npm install create-pg · libregistry