create-db
Version:
Instantly create a temporary Prisma Postgres database with one command, then claim and persist it in your Prisma Data Platform project when ready.
107 lines (76 loc) ⢠3.05 kB
Markdown
`create-db` is an open-source CLI tool that provisions [**temporary Prisma Postgres databases**](https://www.prisma.io/postgres?utm_source=create_db_npm_docs) with a single command.
Each database is available for **24 hours** by default. To keep the database permanently, you can **claim it for free** using the URL displayed in the CLI output.
This tool is designed for developers who need a fast way to test, prototype, or integrate Prisma Postgres without manual setup or creating an account.
There is no need to install the tool globally. Simply run:
```bash
npx create-db@latest
```
You can also use the following aliases:
```bash
npx create-pg@latest
npx create-postgres@latest
```
```bash
npx create-db
npx create-db --region eu-west-1
npx create-db --i
```
You can run `npx create-db --help` or `npx create-db -h` to see all the available CLI options:
```
npx create-db [options]
Options:
--region <region>, -r <region> Specify a region
Available regions:
ap-southeast-1, ap-northeast-1,
eu-central-1, eu-west-3,
us-east-1, us-west-1
--interactive, -i Run in interactive mode
--help, -h Show this help message
```
```
ā š Creating a Prisma Postgres database
ā
ā Provisioning a temporary database in us-east-1...
ā
ā It will be automatically deleted in 24 hours, but you can claim it.
ā
ā Database created successfully!
ā
ā Connect to your database ā
ā
ā Prisma connection string:
ā prisma+postgres://accelerate.prisma-data.net/?api_key=...
ā
ā Standard connection string:
ā postgresql://<username>:<password>@db.prisma.io:5432/postgres
ā
ā Claim your database ā
ā
ā Want to keep your database? Claim for free:
ā https://create-db.prisma.io?projectID=proj_...
ā
```
When you create a database using `create-db`, it is temporary and will be deleted automatically after **24 hours**.
The CLI output includes a **claim URL** that allows you to keep the database permanently for free.
**What claiming does:**
- Moves the database into your Prisma Data Platform account.
- Prevents it from being auto-deleted.
- Lets you continue using the database as a long-term instance.
Example:
```
ā Claim your database ā
ā
ā Want to keep your database? Claim for free:
|
ā https://create-db.prisma.io?projectID=proj_...
ā
ā Your database will be deleted on 7/24/2025, 2:25:41 AM if not claimed.
```
- Refer to the section in the official [Prisma Postgres documentation](https://www.prisma.io/docs/postgres/introduction/npx-create-db).