support prisma extensions
- Dominant language
- TypeScript
- Stars
- 14.1k
- Forks
- 803
- PR merge metrics
- No merged PRs in 30d
Description
### What do you want and why?
handle `$extends()` prisma function (currently errors to `TypeError: (intermediate value).$extends is not a function`
- The types of the __enhanced__ `PrismaClient` break when extensions are added.


#### (Correct) DB types using `new PrismaClient()` without blitz enhancement (cannot be used due to [this](https://github.com/blitz-js/blitz/issues/4251#issuecomment-1909851287)):

### Additional Context
The error of using
```ts
const db = new EnhancedPrisma().$extends(...)
```

Contributor guide
Research direction
Start by reproducing the reported `TypeError` with `new EnhancedPrisma().$extends(...)` and compare its types with a plain `new PrismaClient()`. Trace how Blitz enhances Prisma and verify that extensions work at runtime and that the enhanced PrismaClient types remain usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100