From the CLI
Use the CLI when you want Prisma ORM and Prisma Postgres set up without leaving the terminal.
bun create prisma@latestpnpm create prisma@latestyarn create prisma@latestnpm create prisma@latestChoose PostgreSQL when prompted, and answer No to Deploy to Prisma now?. Setup adds prisma-8.md, installs project-level Prisma ORM skills for your coding agent, and writes the generated scripts used below.
Choose PostgreSQL when prompted, and answer No to Deploy to Prisma now?. Setup adds prisma-8.md, installs project-level Prisma ORM skills for your coding agent, and writes the generated scripts used below.
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@latestpnpm dlx create-db@latestyarn dlx create-db@latestnpx 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.
export 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.
From the generated project directory, run:
bun run db:initpnpm run db:inityarn db:initnpm run db:initSample users are seeded automatically on the app's first query.
bun run devpnpm run devyarn devnpm run devIf the app already exists, run Prisma ORM from the project root:
bunx prisma@latest orm initpnpm dlx prisma@latest orm inityarn dlx prisma@latest orm initnpx 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.
Choose 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.
- Use Import from PostgreSQL when your source database is PostgreSQL.
- Use Import from MySQL when your source database is MySQL.