prismaExtension
Use Prisma with Trigger.dev. Three modes depending on your Prisma version and needs.
Setup
ts
import { prismaExtension } from "@trigger.dev/build/extensions/prisma";
export default defineConfig({
project: "<project ref>",
build: {
extensions: [
prismaExtension({
version: "5.19.0", // your prisma version
provider: "postgresql",
schema: "./prisma/schema.prisma", // default: auto-detected
}),
],
},
});Three Modes
legacy (Prisma < 5.2.0)
ts
prismaExtension({
version: "4.x.x",
provider: "postgresql",
mode: "legacy",
})Downloads full Prisma binary for schema.prisma. Used for older Prisma versions.
engine-only (Prisma 5.2.0 – 6.x, default)
ts
prismaExtension({
version: "5.19.0",
provider: "postgresql",
mode: "engine-only", // can be omitted — this is the default
})Downloads only the query engine. More efficient than legacy mode.
modern (Prisma 6.6.0+, recommended for new projects)
ts
prismaExtension({
version: "6.6.0",
provider: "postgresql",
mode: "modern",
})No engine files downloaded — uses Prisma's new architecture. Requires Prisma 6.6.0+.
Mode is required in Prisma 4.1.1+
Starting with @trigger.dev/build 4.1.1, mode defaults to engine-only if not specified. Set explicitly for clarity.
Version Compatibility
| Prisma Version | Recommended Mode |
|---|---|
| < 5.2.0 | legacy |
| 5.2.0 – 6.5.x | engine-only |
| 6.6.0+ | modern |
Binary Targets
ts
prismaExtension({
version: "5.19.0",
provider: "postgresql",
binaryTargets: ["debian-openssl-3.0.x"],
})Environment Variables
The extension auto-sets these based on your schema:
DATABASE_URL— primary database connection
Multiple Schema Files
ts
prismaExtension({
version: "5.19.0",
provider: "postgresql",
schema: "./prisma/schema.prisma",
})For multiple schemas, add multiple extension entries.