Skip to content

Type inference lost when enhancing a client with prisma extensions #2175

@genu

Description

@genu

DynamicClientExtensionThis

Thanks for making the fix @genu ! These types can indeed be imported directly from "@prisma/client/runtime/library" instead. The code changes look good to me, and I'll make some minor tweaks and add a test then merge.

Thank you!

@ymc9 From my observation, this partly resolved the issue.

type inference is lost when using prisma extensions:

const prisma = new PrismaClient()
const db = enhance(prisma)

db.user.find() // <-- db.user is properly typed

With Enhanced client:

const prisma = new PrismaClient().$extends({})

const db = enhance(prisma)

db.user.find() // <-- db.user is any

Originally posted by @genu in #2171 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions