Introspection in the client extensions
Say I have a client exension:
The
model
here is just a string. How can I figure out if there's a unique constraint in the args, and what it is? Anyway to determine if the model has an @id
field? I want to make something smarter than just a generic query cache.3 Replies
Hey @chad3814 👋
How can I figure out if there's a unique constraint in the args, and what it is?You would need to use
Prisma.dmmf
property to get this information.
Please note that dmmf is an internal property and there maybe breaking changes in minor versions.Please note that dmmf is an internal property and there maybe breaking changes in minor versions.Any plans to make a public property?
I don't think there are any immediate plans to make DMMF public yet