# Prisma + PostgreSQL

Used by the [build playbook](https://www.ihatereading.lol/build.md) on ihatereading.lol.

### Prisma + PostgreSQL

Kind: database

Official links:

- [Prisma docs](https://www.prisma.io/docs)
- [Prisma + Next.js](https://www.prisma.io/docs/orm/more/help-and-troubleshooting/nextjs-guide)
- [Prisma schema](https://www.prisma.io/docs/orm/prisma-schema)
- [Transactions](https://www.prisma.io/docs/orm/prisma-client/queries/transactions)
- [Neon (hosted Postgres)](https://console.neon.tech)
- [Neon connection string](https://neon.tech/docs/connect/connect-from-any-app)
- [Vercel Postgres](https://vercel.com/docs/storage/vercel-postgres)
- [prisma npm](https://www.npmjs.com/package/prisma)

npm packages:

- `prisma`
- `@prisma/client`

API keys:

- `DATABASE_URL`: Postgres connection string from Neon, Vercel Postgres, Supabase, or Railway. prisma+postgres://... or postgresql://...

Setup:

```
1. Create a Postgres database (Neon is fastest: https://console.neon.tech)
2. Copy the connection string → DATABASE_URL
3. npx prisma init && define Listing, Bid, PendingCheckout
4. npx prisma migrate dev --name init
```


All platforms: https://www.ihatereading.lol/build/platforms.md
