{"id":42561,"library":"create-postgres","title":"Create Postgres (by Prisma)","description":"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.","status":"active","version":"1.2.1","language":"javascript","source_language":"en","source_url":"https://github.com/prisma/create-db","tags":["javascript","prisma","postgres","cli","database","temporary","typescript"],"install":[{"cmd":"npm install create-postgres","lang":"bash","label":"npm"},{"cmd":"yarn add create-postgres","lang":"bash","label":"yarn"},{"cmd":"pnpm add create-postgres","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only (library ships ESM). Also ships TypeScript types.","wrong":"const createPostgres = require('create-postgres')","symbol":"createPostgres","correct":"import { createPostgres } from 'create-postgres'"},{"note":"Named export for claiming a temporary database into a Prisma Data Platform project.","wrong":null,"symbol":"claimDatabase","correct":"import { claimDatabase } from 'create-postgres'"},{"note":"Named export to destroy a temporary database when done.","wrong":null,"symbol":"destroyDatabase","correct":"import { destroyDatabase } from 'create-postgres'"}],"quickstart":{"code":"import { createPostgres } from 'create-postgres';\n\nasync function main() {\n  const db = await createPostgres();\n  console.log('Temporary database URL:', db.url);\n  // Use the URL in your Prisma client or connection\n  // When ready to persist, call claimDatabase:\n  // await claimDatabase({ url: db.url, token: process.env.PRISMA_TOKEN ?? '' });\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Creates a temporary Prisma Postgres database, logs its connection URL, and demonstrates optional claim to persist."},"warnings":[{"fix":"Use claimDatabase() to persist the database to a Prisma Data Platform project before expiration.","message":"Temporary databases are automatically destroyed after 24 hours if not claimed.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure you are logged in via `prisma login` or set PRISMA_TOKEN environment variable.","message":"createPostgres requires an active internet connection and a Prisma Data Platform account.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use import syntax or switch to dynamic import() if using CommonJS.","message":"The package is ESM-only; CommonJS require() will fail.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.2.1':34 'allow':21 'auto':67 'auto-handl':66 'cadenc':45 'claim/persist':76 'cli':10,81 'command':64 'connect':69 'creat':1,6 'create-postgr':5 'current':37 'data':51 'databas':19,32,57,82 'develop':22 'differenti':61 'experi':24 'follow':42 'handl':68 'instant':20 'integr':47 'javascript':78 'local':31 'one':63 'one-command':62 'persist':54 'platform':52 'postgr':2,7,18,80 'prisma':4,17,43,50,72,79 'project':60 'releas':39,41 'schema':73 'set':28 'setup':65 'spin':13 'stabl':38 'string':70 'support':75 'temporari':16,56,83 'test':26 'tight':48 'tool':11 'typescript':84 'version':33 'via':71 'without':27 'workflow':77","created_at":"2026-06-05T16:55:35.164527+00:00","updated_at":"2026-06-05T16:55:35.164527+00:00","problems":[{"fix":"Run `npm install create-postgres` or `yarn add create-postgres`, then verify import path.","cause":"Package not installed or wrong import path.","error":"Error: Cannot find module 'create-postgres'"},{"fix":"Change to `import { createPostgres } from 'create-postgres'` or use `await import('create-postgres')`.","cause":"Incorrect import (CommonJS require) instead of ESM import.","error":"TypeError: createPostgres is not a function"},{"fix":"Run `prisma login` or set PRISMA_TOKEN environment variable with a valid token.","cause":"Missing or invalid authentication token.","error":"Error: Unauthorized - please authenticate with Prisma Data Platform"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/prisma/create-db#readme","github":"https://github.com/prisma/create-db","docs":null,"changelog":null,"pypi":null,"npm":"create-postgres","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}