zenstack
zenstack copied to clipboard
[Feature Request] Add option to rename "prisma" variable name in generated trpc routes
I would like to rename the variable that zenstack uses for accessing the database in the trpc context on generated routes. By default it is hardcoded as "prisma", but in my code it should be "db".
Calling it as prisma is misleading and confuses AI based edits since it's not really prisma but a zenstack enhanced prisma client.
Is it possible to add an option in this to the trpc plugin?
Hi @hongkongkiwi , I agree such a customization would be useful. Will you be interested in making a PR? I'll be happy to facilitate.
I correct understand, you mean in "export function db(ctx: any)" replace "ctx.prisma" to "ctx.db" ?