Database
Prisma on PostgreSQL, MySQL or MongoDB, with a schema folder per module.
Requires:Works on its own
Providers
Pick one to update the preview and filesPreview
Database
- prisma/schema.prismagenerator + datasource only
- prisma/schema/auth.prismaUser, Session, Account, Verification
- prisma/schema/payments.prismaCustomer, Subscription
- prisma/schema/storage.prismaStoredFile
- prisma/schema/ai.prismaAiThread, AiMessage
What it adds
7 things, working end to end- Prisma as the only ORM, with a db singleton in lib/db
- prisma/schema.prisma holds the generator and datasource only: each module adds its models in prisma/schema/<module>.prisma
- prisma.config.ts pointing at the schema folder
- A seed script (prisma/seed.ts)
- Connection pool settings from environment variables
- MongoDB adds a small lib/db/utils.ts for its differences
- Migration and schema rules written for coding agents
Set up PostgreSQL
Accounts and keys, in this order- 1Get a databaseUse a hosted Postgres or a local container.Your hostCreate database
- 2Copy the connection stringAdd
?sslmode=requirefor hosted databases..envDATABASE_URL="postgresql://user:password@host:5432/dbname"DATABASE_POOL_SIZE=10DATABASE_POOL_TIMEOUT=20 - 3Create the tablesPush the Prisma schema, then start the app.npx prisma db push
Environment variables
For the selected provider.env
# Connection string of your database
DATABASE_URL=
# Connection pool size (optional)
DATABASE_POOL_SIZE=
# Pool timeout in seconds (optional)
DATABASE_POOL_TIMEOUT=
Works with
Other modules this one connects toAdd it to your repo
Pick the preset in the builder, check the providers, and download a repo that already has this module wired in.
