PrismaClient export from generated client.
Hey, this may be an irrelevant feature generally, but it's something I would really appreciate, which is can we try and make it so the client export is always defined as "PrismaClient", at the moment you can do:
But the output of:
Whereas it used to be "PrismaClient".
I am using dependency injection in a library and we use the class name as the injection key but since your generator instead names it
r and I assume potentially other letters, wondering if we can standardise it so it stays the same regardless and for that specific class it doesn't get "minified" to a letter.
Thanks.3 Replies
You selected the carefully hand-crafted route. A dev artisan will respond soon. Meanwhile, the
#ask-ai channel awaits if you're curious!If you have another suggestion to deal with this, then feel free to let me know, but the framework I am working on, at the moment, it currently uses the
schema.prisma file to find the output folder, and then dynamically (await import) the module, this allows my framework to initialise the prisma library ahead of time, so the user just has to "inject" it to their library.
I normally use reflection to add metadata, but you can't do that when you use await import as it doesn't cache the reflection metadata against the import, and so far I have found no other way to make this work.
Before:
Now:
I appreciate it's not the end of the world, but it's a royal pain in the ass, and now we are/will be forced to use this "new way" of importing it, would be appreciated, if we could at least get consistent class names under the hood for things like this in the future.Hey!
Do you know since which prisma version you started observing this change?