Skip to main content

Getting started

Quickstart

To bootstrap a new Prisma ORM project with a Prisma Postgres database, run the following command in your terminal:

npx prisma init --db

After running this command, the terminal will guide you with next steps. Follow this page to complete the setup for your first Prisma Postgres project.

note

If you need a database quickly for testing, or want to try out Prisma Postgres, you can run the following command to spin up a temporary 24-hour database:

npx create-db@latest

You can learn more about npx create-db in the dedicated documentation.

Prisma ORM

The easiest ways to get started with Prisma Postgres is by following these guides:

If you are looking to explore Prisma Postgres in a fullstack project, check out these resources:

note

When you are using Prisma Postgres, you don't need to include the query engine in the generated Prisma Client code. Make sure to always generate it using the --no-engine flag:

prisma generate --no-engine

Connect via any database library / tool

You can access Prisma Postgres with any ORM or database tool of your choice via direct TCP connections.

In order to get a direct TCP connection string, you need to:

  1. Navigate to your active Prisma Postgres instance.
  2. Click the API Keys tab in the project's sidenav.
  3. Click the Create API key button.
  4. In the popup, provide a Name for the API key and click Create.
  5. Copy the connection string starting with postgres://, this is your direct connection string.

Once you have the connection string, you can follow the setup docs for PostgreSQL of any ORM or database tool: