@map for table fields is incorrect
annibuliful opened this issue ยท 8 comments
Hey again @annibuliful. I spent some time looking into this and it seems like Prisma don't provide information about field mappings to generators. Check out this issue: prisma/prisma#3998. For the time being, I don't think there's any reasonable way to support this. Sorry about that ๐
In the meantime, you should just be able to call the field map_action
. I know it's ugly to have a single snake case field... but probably better than not having access to the field at all?
Awesome to have someone like you using the library and reporting issues. It's super valuable, thank you again ๐
I've added a section to the README that explains this
Please make sure to leave a comment on prisma/prisma#3998 that mentions that this leads to a limitation in your custom generator - we will take this into account with prioritization. Thanks.
(๐ from @prisma)
@janpio Done! Cool to see someone form Prisma lurking here. I appreciate you reaching out ๐ ๐
I was just working on a generator myself, and it looks like this does exist - DMMF.Field
has a property that gets filled out with @map
statements called dbName
. Note that it's incorrect on the typings, which denote it as an array called dbNames
. I have a pending PR for that
@luxaritas Awesome, thanks for letting me know. I'll look into this.
I've made a first pass at adding support for this in pr #22. Here's a snapshot version for you guys to try: 0.0.0-snapshot-20230420160205
. @annibuliful
Thank you so much