Skip to main content
Version: 2.x

@core/enhancer

The @core/enhancer plugin generates JavaScript modules that support runtime enhancement of Prisma Client. The generated modules include the following:

  • enhance

    The enhance API that creates a proxy around a PrismaClient instance to extend its behavior. When using the default output location, you can import this API from @zenstackhq/runtime.

  • model-meta

    Lightweight runtime representation of ZModel's AST.

  • policy

    Partial Prisma query input objects and input checker functions compiled from access policy expressions.

info

This plugin is always automatically included when zenstack generate is run. You only need to add it to your ZModel if you want to customize its options.

Installation

This plugin is built-in to ZenStack and does not need to be installed separately.

Options

NameTypeDescriptionRequiredDefault
outputStringOutput directory (relative to the path of ZModel)Nonode_modules/.zenstack
compileBooleanIf the generated TS code should be compiled to JSNotrue
preserveTsFilesBooleanIf the generated TS files should be preserved (after compiled to JS)Notrue if compile is set to false, otherwise false

Example

/schema.zmodel
plugin enhancer {
provider = '@core/enhancer'
output = 'src/lib/zenstack'
compile = false
}
Comments
Feel free to ask questions, give feedback, or report issues.

Don't Spam


You can edit/delete your comments by going directly to the discussion, clicking on the 'comments' link below