You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Can't get model name when extending prisma client #19821
This is not the API that exists in the current version of Prisma. compute callback receives the dependencies of your computed field (fields of your model you specify in needs), nothing more, nothing less. It does not receive any information on top of that, like modelName in your examples.
I've converted the issue into the feature request.
Activity
SevInf commentedon Jun 19, 2023
Hi @ghostlexly.
This is not the API that exists in the current version of Prisma.
computecallback receives the dependencies of your computed field (fields of your model you specify inneeds), nothing more, nothing less. It does not receive any information on top of that, likemodelNamein your examples.I've converted the issue into the feature request.
SevInf commentedon Jun 19, 2023
Note for the future: here is a couple of ideas of how this feature might look like once we get to it:
getExtensionContextThis is consistent with how we do it for
modelextensions:Second argument to the
computeSince
computearguments are not exposed via extended client directly (unlike model extensions) we can also do simpler and more discoverable variant:sakgoyal commentedon Feb 17, 2024
is there a status update on if/when this will be done?
vic-blt commentedon Feb 6, 2026
@SevInf Something like that https://github.com/vic-blt/prisma/commit/38cdd027412b6d8fd5e67c592f450c7253d01973 ?
feat(client): expose ModelName to compute function in Result extensio…
feat(client): expose ModelName to compute function in Result extensio…