vacuumdreams / prisma-generator-proto

Generate proto files from prisma schema
MIT License
1 stars 2 forks source link

Relational scalar fields are being omitted from the proto services #47

Open azat-co opened 8 months ago

azat-co commented 8 months ago

Thank you for a useful library. Maybe I'm not understanding something but Prisma relational scalar fields are being omitted from the proto services. According to Prisma docs they are read-only fields. For example: authorId in Post entity. I removed this like and the scalar fields started to appear in the generated proto services which is what I need. Maybe there's another better way but I can't figure how to update an author on a Post without having authorId in Post proto service.

I also have a case where I have a self referencing scalar field that needs to reference the same entity. This is for hierarchical structure. For a example, a table of organizations where an organization can be a child or a parent of another organizations. So I need to be able to update parentId on Organization entity via gRPC service.

If this is a bug, I'm happy to send a pull request.

azat-co commented 7 months ago

@vacuumdreams what do you think?