Prisma Accelerate
- Dominant language
- TypeScript
- Stars
- 14.1k
- Forks
- 803
- PR merge metrics
- No merged PRs in 30d
Description
### What do you want and why?
I want to migrate my blitz app from previous Prisma Data Proxy to the new Accelerate product but extending prisma + enhancePrisma + blitz-server AuthServerPlugin PrismaStorage types don't play well together
### Possible implementation(s)
```ts
import { PrismaClient } from '@prisma/client'
import { withAccelerate } from '@prisma/extension-accelerate'
import { enhancePrisma } from 'blitz'
const EnhancedPrisma = enhancePrisma(PrismaClient)
export default new EnhancedPrisma().$extends(withAccelerate())
```
This breaks all db collection types in tsc and using it without enhancePrisma just breaks the types in PrismaStorage(db)
```ts
export const { gSSP, gSP, api } = setupBlitzServer({
plugins: [
AuthServerPlugin({
...authConfig,
storage: PrismaStorage(db),
...
}),
],
...
})
```
### Additional context
Latest blitz version

Contributor guide
Research direction
Start by reproducing the TypeScript errors with enhancePrisma, the Prisma Accelerate extension, and PrismaStorage(db) in the setup shown. Trace the types used by enhancePrisma, AuthServerPlugin, and PrismaStorage; done means an Accelerate-extended client works with PrismaStorage without breaking database collection types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- next.js, typescript
- Domain
- authentication, backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100