Skip to content

Commit

Permalink
Fix typo in Prisma adapter doc (#629)
Browse files Browse the repository at this point in the history
Co-authored-by: Iain Collins <me@iaincollins.com>
  • Loading branch information
Ugo Onali and iaincollins committed Sep 8, 2020
1 parent 1777a87 commit 2f0f738
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions www/docs/schemas/adapters.md
Expand Up @@ -190,26 +190,26 @@ npx @prisma/cli generate

You can add properties to the schema and map them to any database colum names you wish, but you should not change the base properties or types defined in the example schema.

The model names themselves can be changed with a configuration option, and the datasource can be changed to anything supported by Prisma.
The model names themselves can be changed with a configuration option, and the datasource can be changed to anything supported by Prisma.

You can use custom model names by using the `modelMapping` option (shown here with default values).

```javascript title="pages/api/auth/[...nextauth].js"
...
adapter: Adapters.Prisma.Adapter({
adapter: Adapters.Prisma.Adapter({
prisma,
modelMapping: {
User: 'user',
Account: 'account',
Session: 'session',
VerificationRequest: 'verificationRequest'
}
}
})
...
```

:::tip
If you experience issues with Prisma opening too many database connections opening in local development mode (e.g. due to Hot Module Reloading) you can use an approach like this when initalising the Prisma Client:
If you experience issues with Prisma opening too many database connections in local development mode (e.g. due to Hot Module Reloading) you can use an approach like this when initalising the Prisma Client:

```javascript title="pages/api/auth/[...nextauth].js"
let prisma
Expand Down

1 comment on commit 2f0f738

@vercel
Copy link

@vercel vercel bot commented on 2f0f738 Sep 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.