if you have a local postgresql or you want to use another database, just like sqlite
docker run --name postgres -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d postgres
pnpm install @prisma/client
npx prisma init
npx prisma migrate dev --name init
npx prisma migrate resolve --applied init
npx prisma migrate dev --skip-generate --name init
npx prisma generate
import {PrismaClient} from '@prisma/client'
const prisma = new PrismaClient({
log: ["error", "info", "warn", "query"]
})
export default prisma
npx prisma studio
(async () => {
return await prisma.tableName.findMany()
})()
npx prisma db pull
npx prisma db push