Skip to content

[Feature request] Make zenstack_guard optional #415

@JYachelini

Description

@JYachelini

Problem
Hi, I am using zenstack for an API. I accessed zenstack only to modularize prisma schemas and to be able to extend schemas, they seemed to me very good features that prisma should include, but it doesn't do it.

The problem I have is that it always generates the zenstack_guard column when I don't need it, since I'm not going to use auth() because I do it from my API controller.

To solve this problem I had to use the "sed" command and when the zenstack generate command is executed, the sed command deletes the zenstack_guard lines.
Example:
'npx zenstack generate && sed -i '' 's/zenstack_guard Boolean @default(true)//g' prisma/schema.prisma && npx prisma generate.

Posible solution (feature)
The simplest solution is to add in the zenstack.config.json something like "guardField": Boolean (default true)

zenstack.config.json

{
  "guardField": false
}

I hope I have explained it well.

Aditional
It would be nice to add the option to choose the output of zenstack generate in zenstack.config.json, if it already exists I did not find it.

zenstack.config.json

{
  "output": "./src/database/prisma" (path)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions