prisma / prisma

Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB
https://www.prisma.io
Apache License 2.0
38.79k stars 1.52k forks source link

Add `Unsupported` columns to DMMF #20756

Open dylel opened 1 year ago

dylel commented 1 year ago

Problem

As of right now, the DMMF information doesn't include anything related to the "Unsupported" column type and prevents generators like "kysely-prisma" from being able to generate types. Although prisma can't handle the types directly, if the custom generator can then it should provide this information so it can be translated.

Suggested solution

Add Unsupported columns to the DMMF

Alternatives

If adding to the dmmf isn't possible then provide another function, that can be specifically called to extract unsupported columns for a model from a dmmf so they can be used inside a generator

Additional context

I ran into this trying to override a type using "Prisma-Kysely", i'm using the "geometry" type and the underlying driver from kysely can support the type I want, so I wanted to override the type that Prisma-Kysely generates (which is supported by the generator) except the unsupported columns never make it to the onGenerate function when using the generatorHandler helper

abiriadev commented 2 months ago

Can I check the progress on this feature, or at least find out if it's planned or not?

I am currently building my own type generator and need to handle unsupported types. This feature doesn't seem too difficult to implement (just my guess). If there are any challenges making it hard to solve, please share them here in this issue thread!

I am also willing to contribute to this issue but currently have no idea where to start. Can someone elaborate?