Open jansedlon opened 1 week ago
I prefer building our own parser to support @db.XX. The built-in generator lacks several key features as well, such as relationship information.
I've already developed the prototype but still in playground. The implementation turned out not to be that complex.
But the ability to modify such things should be accommodated with the drizzle.custom, which still in pr currently
If you fancy adding a PR, I think field.func
combined with field.import
should be good. Similar to this.
Or maybe we could make field.coreFunc
to automate the import.
Not sure if you mean the same thing by your own parser, but you can take look here https://github.com/MrLeebo/prisma-ast
Ahh, will definitely try
prisma-generator-drizzle
doesn't support@db.XX
.Because it can't, prisma doesn't provide information about this.
My idea was to support this via directives, likes
/// drizzle.dbType xx
. So basically local overridesI have few fields which are
DateTime @db.Time
but this is generated asdatetime()
. When i query this column, drizzle returns this asInvalid Date
so it's basically unusable.I have a prototype ready for my use case, so will clean the code a bit and make a PR. What do you think about this approach?