-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include @@index
and @map
information in getDMMF
#3998
Comments
Why would that information be helpful for you, what problem does it solve @gogoout? |
Hi, thanks for the quick response. My use case is pretty much like this issue here: IBM/prisma-schema-transformer#8 Current workaround is simply run another |
Another thing I just noticed is missing is the |
@gogoout If that is very related to this issue, just update the description, otherwise open a new issue. |
@@Index
information in getDMMF
@@Index
information in getDMMF
@@Index
and @map
information in getDMMF
This would be an awesome enhancement that would allow for some nice tooling and transforms to be built. I'm needing the @Map attribute for my library aurora that stitches multiple schema files together. Currently, the @Map attributes on fields are being omitted in the resulting schema file because that data isn't present in the |
I also have a use case for this: RobertCraigie/prisma-client-py#249 Prisma Client Python provides helper methods for casting raw queries back to the standard model classes, e.g. query = '''
SELECT *
FROM User
WHERE User.id = ?
'''
user = await client.query_first(query, user.id, model=User)
# or just
user = await User.prisma().query_first(query, user.id) This means that the returned records from raw queries are also type safe! However this does not work for fields that use model User {
id String @id @default(cuid())
name String @map("username")
} This causes a validation error at runtime (showcased in the aforementioned issue). Having access to the mapped name would allow me to easily solve this bug. |
I recommend using https://github.com/MrLeebo/prisma-ast for now until Prisma team complete their dmmf info. |
@@Index
and @map
information in getDMMF
@@index
and @map
information in getDMMF
We also need Shouldn't be a difficult things to fix, right? And would open so many possibilities for better tooling. 🙏 |
For the time being I had to jump through terrible hoops doing prisma.schema pre-processing and extracting all the needed attributes ( But yeah, would be actually great to see all Prisma schema attributes accessible in DMMF. |
I have another use case for this. I cannot currently support |
Hi there. I'm working on a custom generator that generates Kysely types from a Prisma schema. As of right now there's no way for me to support Thanks 😄 |
I wanted to retrieve the indexes to set them manually, because I can't use Sadly not available, sigh... Blocked again. |
@@index
and @map
information in getDMMF
@@index
, @@unique
and @map
information in getDMMF
@@index
, @@unique
and @map
information in getDMMF
@@index
and @map
information in getDMMF
This is similarly related to #17754 wherein DMMF does not distinguish models or views, either via a distinct collection or at least through an attribute. These sorts of issues, especially missing metadata in the DMMF, continue to frustrate work arounds and the fostering of a stronger ecosystem for Prisma. |
Problem
Given schema
using
getDMMF
will dump asthe
@@index
and@map
information are both missing, this make printing dmmf back to schema impossible.Suggested solution
Return indexes in Model field just like
uniqueFields
anduniqueIndexes
.add
colName
orfieldName
to show the original db columnName just likedbName
.The text was updated successfully, but these errors were encountered: