Registry / database / create-postgres

create-postgres

JSON →
library1.2.1jsnpmunverified

create-postgres is a CLI tool that spins up a temporary Prisma Postgres database instantly, allowing developers to experiment or test without setting up a local database. Version 1.2.1 is the current stable release, with releases following Prisma's cadence. It integrates tightly with Prisma Data Platform to persist the temporary database into a project. Differentiators: one-command setup, auto-handles connection strings via Prisma schema, and supports claim/persist workflows.

npm install create-postgres
INSTALL
IMPORT
SIG · CREATE-POSTGRES
C
create-postgres
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.

createPostgres
✓ import { createPostgres } from 'create-postgres'
✗ const createPostgres = require('create-postgres')
ESM-only (library ships ESM). Also ships TypeScript types.
claimDatabase
✓ import { claimDatabase } from 'create-postgres'
Named export for claiming a temporary database into a Prisma Data Platform project.
destroyDatabase
✓ import { destroyDatabase } from 'create-postgres'
Named export to destroy a temporary database when done.

Creates a temporary Prisma Postgres database, logs its connection URL, and demonstrates optional claim to persist.

import { createPostgres } from 'create-postgres'; async function main() { const db = await createPostgres(); console.log('Temporary database URL:', db.url); // Use the URL in your Prisma client or connection // When ready to persist, call claimDatabase: // await claimDatabase({ url: db.url, token: process.env.PRISMA_TOKEN ?? '' }); } main().catch(console.error);
Debug
Known issues
gotchaTemporary databases are automatically destroyed after 24 hours if not claimed.
fix
Use claimDatabase() to persist the database to a Prisma Data Platform project before expiration.
affects: >=1.0.0
gotchacreatePostgres requires an active internet connection and a Prisma Data Platform account.
fix
Ensure you are logged in via `prisma login` or set PRISMA_TOKEN environment variable.
affects: >=1.0.0
gotchaThe package is ESM-only; CommonJS require() will fail.
fix
Use import syntax or switch to dynamic import() if using CommonJS.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'create-postgres'
Package not installed or wrong import path.
fix
Run `npm install create-postgres` or `yarn add create-postgres`, then verify import path.
TypeError: createPostgres is not a function
Incorrect import (CommonJS require) instead of ESM import.
fix
Change to `import { createPostgres } from 'create-postgres'` or use `await import('create-postgres')`.
Error: Unauthorized - please authenticate with Prisma Data Platform
Missing or invalid authentication token.
fix
Run `prisma login` or set PRISMA_TOKEN environment variable with a valid token.
Upgrade
Version history
1.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

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