We will continue using the same project as in your tutorials and previous lectures in this section and the following sections. Please download it from your forked repository (instructions here )
In this section, we will play with Prisma , please install both needed packages:
pnpm i prisma @prisma/client
You will also need access to a Mongodb and Postgres database. We recommend you create an account with Mongodb and Vercel or Neon:
Please use this schema:
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model Post {
id Int @id @default(autoincrement())
title String
content String
date DateTime
tags Tag[] @relation("PostTags")
}
model Tag {
id Int @id @default(autoincrement())
name String @unique
posts Post[] @relation("PostTags")
}
All branches:
Git Branch - “Main”