Skip to main content
Version: Next (2.x)

Prisma Plugin

Regenerates the Prisma client whenever schema.prisma changes, so you never have to remember to run prisma generate by hand.

Installation

yarn add @baeta/plugin-prisma -D

Configuration

In baeta.ts:

baeta.ts
import { defineConfig } from "@baeta/cli";
import { prismaPlugin } from "@baeta/plugin-prisma";

export default defineConfig({
// ... other config
plugins: [
prismaPlugin({
prismaSchema: "schema.prisma",
generatedSchemaPath: "src/__generated__/prisma/schema.prisma", // OR node_modules/@prisma/client/schema.prisma
generateCommand: "prisma generate", // this is the default value
}),
],
});

For the full configuration interface, see the PrismaPluginOptions API reference.

tip

To regenerate the client and push schema changes to the database in one step, set generateCommand: "prisma db push".

How it works

On every run, the plugin:

  • Watches prismaSchema for changes.
  • Runs generateCommand when it sees one.
  • Writes the result to the configured path.