zenstack icon indicating copy to clipboard operation
zenstack copied to clipboard

[Feature Request] Add option to rename "prisma" variable name in generated trpc routes

Open hongkongkiwi opened this issue 6 months ago • 2 comments

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?

hongkongkiwi avatar Jun 06 '25 07:06 hongkongkiwi

Hi @hongkongkiwi , I agree such a customization would be useful. Will you be interested in making a PR? I'll be happy to facilitate.

ymc9 avatar Jun 20 '25 00:06 ymc9

I correct understand, you mean in "export function db(ctx: any)" replace "ctx.prisma" to "ctx.db" ?

DoctorFTB avatar Jun 22 '25 21:06 DoctorFTB