diff --git a/.changesets/11379.md b/.changesets/11379.md new file mode 100644 index 000000000000..eb5cc8086ef7 --- /dev/null +++ b/.changesets/11379.md @@ -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 +```