- Prisma connects the PostgreSQL Database provided by Supabase by using postgres connection string.
- Write the Database Schemas in
prisma/schema.prisma
lib/prisma.ts
contains prisma client config- Use prisma client APIs on
getStaticProps
andgetServerSideProps
in the Next.js project. Also you can use them inpages/api/
as well to perform Database Operations. - Prisma Client APIs cannot be used in the Frontend application.
- This App performs basic CRUD Operations with Prisma + Supabase DB + Next FE and Server
- Create a
.env
as below
DATABASE_URL=<YOUR_SUPABASE-CONNECION-STRING-HERE>
- npm install
- npm run dev
Also, you can visualize the database on local with:
npx prisma studio
If you are using prisma migrate dev
, please refer this without fail.