From the CLI
Start a Prisma ORM app with Prisma Postgres from the command line.
Use the CLI when you want Prisma ORM and Prisma Postgres set up without leaving the terminal.
Start a new app
bun create prisma@latestChoose PostgreSQL when prompted. Setup adds prisma-8.md, installs project-level Prisma ORM skills for your coding agent, and writes the generated scripts used below.
Create the database
Create a Prisma Postgres database from the terminal and export its connection string. The generated scripts read the environment variable, not .env:
bunx create-db@latestexport DATABASE_URL="<the connection string create-db printed>"The command also prints a claim URL; open it within 24 hours to keep the database in your account.
Initialize the database
From the generated project directory, run:
bun run db:initRun the app
Sample users are seeded automatically on the app's first query.
bun run devAdd Prisma ORM to an existing app
If the app already exists, run Prisma ORM from the project root:
bunx prisma@latest orm initChoose PostgreSQL and set DATABASE_URL to your Prisma Postgres connection string. Init adds prisma-8.md, package scripts, and the Prisma ORM skills for your coding agent. Then follow the PostgreSQL existing-project guide.
Import an existing database
- Use Import from PostgreSQL when your source database is PostgreSQL.
- Use Import from MySQL when your source database is MySQL.
