Course

Prisma Project Setup

Before we can begin to write our first Prisma application, we need to install the Prisma CLI, dependencies and initialize a new Prisma project in our working directory.

Let's follow our setup guide to get started.

Prisma

npm install prisma --save-dev
npm install @prisma/client

Then we can initialize a new Prisma project in our working directory.

npx prisma init

Supabase

Setup a in Prisma and import the Direct and Database URLs from Supabase into our

Refer to This Lesson for Help

Connecting Supabase to Prisma

Use our Prisma schema to connect to Supabase by updating the datasource block in the schema.prisma file.

schema.prisma
  datasource db {
    provider  = "postgresql"
    url       = env("DATABASE_URL")
    directUrl = env("DIRECT_URL")
  }
Insight

The is what Prisma will use to connect to the database for queries like inserts, updates, and deletes. The is what Prisma will use to connect to the database when it needs to update the schema like adding or removing tables or rules.

We're all set up and ready to start writing our first Prisma application. In the next lesson, we'll discuss how to define our Prisma schema.

0 Comments

"Please login to view comments"

glass-bbok

Join the Conversation!

Subscribing gives you access to the comments so you can share your ideas, ask questions, and connect with others.

Upgrade your account
tick-guideNext Lesson

Defining our Schema