Docs
Database
Database
How to config your Neon database.
The project was start with PlanetScale like database. But the free tier has been recently removed.
Currently this project uses Neon (PostgreSQL) on the free plan. Check their pricing page for more information. Prisma is used as the ORM.
Steps
Create Neon account
If don't have an account on Neon, just follow their steps here for create one.
Copy database url
After create a project on Neon, you can copy the database url. Select Prisma
from the list then the env
tab.
Don't forget to reveal the information hidden behind the stars using the eye icon. It's not very visible in dark mode.
Paste in your .env.local
file.
DATABASE_URL=postgres://user:password@ep-your-neon-host.aws.neon.tech/dbname
Generate client and apply schema
Install deps first, then generate Prisma client and sync schema.
pnpm install
pnpm prisma generate
pnpm prisma db push
If you intend to use migrations, run:
pnpm prisma migrate dev -n init