Skip to content

Commit

Permalink
Add changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
dac09 committed Aug 28, 2024
1 parent 9d2b445 commit f904184
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .changesets/11379.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
- template(db): Update `api/src/lib/db` template (#11379) by @dac09

Updates the template in `api/src/lib/db.{js,ts}` to export `db` differently.

In your existing projects, you can make the following changes:

```diff

import { PrismaClient } from '@prisma/client'

import { emitLogLevels, handlePrismaLogging } from '@redwoodjs/api/logger'

import { logger } from './logger'
import { prismaExtension } from './uploads'

- export const db = new PrismaClient({
+ const prismaClient = new PrismaClient({
log: emitLogLevels(['info', 'warn', 'error']),
})

handlePrismaLogging({
- db
+ db: prismaClient,
logger,
logLevels: ['info', 'warn', 'error'],
})

+ export const db = prismaClient
```

0 comments on commit f904184

Please sign in to comment.