If you want to also run migrations during the build process, you can pass in the migrate option:
Copy
Ask AI
import { defineConfig } from "@trigger.dev/sdk/v3";import { prismaExtension } from "@trigger.dev/build/extensions/prisma";export default defineConfig({ project: "<project ref>", // Your other config settings... build: { extensions: [ prismaExtension({ schema: "prisma/schema.prisma", migrate: true, directUrlEnvVarName: "DATABASE_URL_UNPOOLED", // optional - the name of the environment variable that contains the direct database URL if you are using a direct database URL }), ], },});
If you have multiple generator statements defined in your schema file, you can pass in the clientGenerator option to specify the prisma-client-js generator, which will prevent other generators from being generated. Some examples where you may need to do this include when using the prisma-kysely or prisma-json-types-generator generators.
Copy
Ask AI
datasource db { provider = "postgresql" url = env("DATABASE_URL") directUrl = env("DATABASE_URL_UNPOOLED")}// We only want to generate the prisma-client-js generatorgenerator client { provider = "prisma-client-js"}generator kysely { provider = "prisma-kysely" output = "../../src/kysely" enumFileName = "enums.ts" fileName = "types.ts"}generator json { provider = "prisma-json-types-generator"}
If you are using TypedSQL, you’ll need to enable it via the typedSql option:
Copy
Ask AI
import { defineConfig } from "@trigger.dev/sdk/v3";export default defineConfig({ project: "<project ref>", // Your other config settings... build: { extensions: [ prismaExtension({ schema: "prisma/schema.prisma", typedSql: true, }), ], },});
The prismaExtension will inject the DATABASE_URL environment variable into the build process. Learn more about setting environment variables for deploying in our Environment Variables guide.
These environment variables are only used during the build process and are not embedded in the final container image.