Connecting Your Database for Enhanced Features:
This guide outlines the database options and setup steps for enabling features like Chat Link Sharing in your application.
1. Serverless Postgres (default):
postgres://USER:PASS@SOMEHOST.postgres.vercel-storage.com/SOMEDB?pgbouncer=true&connect_timeout=15
2. MongoDB Atlas (alternative):
mongodb://USER:PASS@CLUSTER-NAME.mongodb.net/DATABASE-NAME?retryWrites=true&w=majority
Variable | |
---|---|
POSTGRES_PRISMA_URL | postgres://USER:PASS@SOMEHOST.postgres.vercel-storage.com/SOMEDB?pgbouncer=true&connect_timeout=15 |
POSTGRES_URL_NON_POOLING (optional) | URL for the Postgres database without pooling (specific use cases) |
Variable | |
---|---|
MDB_URI | mongodb://USER:PASS@CLUSTER-NAME.mongodb.net/DATABASE-NAME?retryWrites=true&w=majority |
When using MongoDB Atlas, you'll need to make the below changes to the file src/server/prisma/schema.prisma
.
...
datasource db {
provider = "mongodb"
url = env("MDB_URI")
}
//
// Storage of Linked Data
//
model LinkStorage {
id String @id @default(uuid()) @map("_id")
// ...rest of file
npx prisma db push
: Create or update the database schema (run once after connecting).