Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ Copy `config-skel.json` to `config.json` and adjust the options (all options are
- `google_oauth2`:
- `enabled`: if true, the login endpoint will accept the token for authenticating with Google OAuth2 token. Note that you have to set "GOOGLE_CLIENT_ID" in your environment
to your API Key Client ID.
- `prisma_options`: these settings will be passed to Prisma PGClient creation. See [Prisma documentation](https://www.prisma.io/docs/orm/reference/prisma-client-reference#prismaclient) for possible values.

## 5. Prepare the database

Expand Down
7 changes: 5 additions & 2 deletions lib/db.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@

import { PrismaPg } from '@prisma/adapter-pg'
import { PrismaClient } from '../generated/prisma/index.js'
import * as Config from './config.mjs'

const adapter = new PrismaPg({
const pclient = Config.get()?.prisma_options || {}

pclient.adapter = new PrismaPg({
connectionString: process.env.PASSWEAVERAPI_PRISMA_URL
})

const DB = new PrismaClient({ adapter })
const DB = new PrismaClient(pclient)

export default DB