Skip to main content
Version: 2.x

@core/prisma

The @core/prisma plugin generates a Prisma schema from ZModel.

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 file path (relative to the path of ZModel)No./prisma/schema.prisma
generateClientBooleanWhether to run prisma generate after generationNotrue
generateArgsStringCommand line arguments appended to the prisma generate call, e.g., "--no-engine". Please note that the "--schema" option is automatically passed, and you shouldn't provide it explicitly.No
formatBooleanWhether to run prisma format after generationNotrue
customAttributesAsCommentsBooleanWhether to generate non-Prisma attributes (e.g., @@allow) as comments in the Prisma schemaNofalse

Example

/schema.zmodel
plugin prisma {
provider = '@core/prisma'
output = './src/prisma/schema.prisma'
}
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