prisma/prisma
Configuration
Configuration files, environment variables, and the schema/config wiring.
prisma.config.ts
The user-facing project configuration. Loaded by @prisma/config. See packages/config for implementation; PrismaConfigInternal for the parsed shape.
import { defineConfig, env } from 'prisma/config';
export default defineConfig({
schema: 'prisma/schema.prisma',
migrations: {
path: 'prisma/migrations',
},
datasource: {
url: env<{ DATABASE_URL: string }>('DATABASE_URL'),
},
});Notable behaviors:
- SQLite URLs are resolved relative to the config file, not the schema file.
.envfiles are not auto-loaded. Useimport 'dotenv/config', or a runtime that loads.envnatively (Bun,node --env-file=.env,tsx --env-file=.env).loadedFromFileonPrismaConfigInternalflags whether the config came from disk.
Schema-level configuration
schema.prisma declares two non-model concerns:
datasource db { provider = "..." }— only the provider in Prisma 7. URLs come from the config file.generator client { provider = "..." }— chooses betweenprisma-client(TS) andprisma-client-js(JS), plusoutputand per-generator settings.
Environment variables that affect Prisma
| Variable | Effect |
|---|---|
DEBUG=prisma:* |
Enable internal debug logs |
FORCE_PANIC_SCHEMA_ENGINE=1 |
Force Schema Engine panic on next migrate command |
FORCE_PANIC_PRISMA_SCHEMA=1 |
Force PSL parser panic on next prisma format |
FORCE_PANIC_GET_DMMF=1 |
Force panic in getDMMF |
FORCE_PANIC_GET_CONFIG=1 |
Force panic in getConfig |
PRISMA_HIDE_UPDATE_MESSAGE=1 |
Disable the CLI's update-available message |
PRISMA_DISABLE_WARNINGS=1 |
Suppress non-fatal warnings |
NO_COLOR=1 |
Disable terminal color output |
Adapter-specific (e.g., DATABASE_URL) |
Read by the user's prisma.config.ts via env(...) |
The Force-panic variables are documented in CONTRIBUTING.md. DEBUG follows the standard debug package convention.
Workspace configuration
| File | Purpose |
|---|---|
pnpm-workspace.yaml |
Workspace globs (packages/*) |
turbo.json |
Turborepo task graph (build, dev) |
package.json (root) |
Engines, scripts, dev deps, size-limit ceilings |
tsconfig.json |
Root TypeScript config (tsconfig.build.bundle.json for bundling) |
.envrc |
direnv hooks for contributor env |
.db.env |
Test database connection details |
.npmrc |
npm/pnpm settings |
.prettierrc.yml |
Prettier config |
.prettierignore |
Prettier ignore |
eslint.config.cjs |
ESLint flat config |
eslint-local-rules/ |
Project-specific ESLint rules |
.gitleaksignore |
gitleaks (secret scanning) ignore |
.husky/ |
Git hooks |
vitest.config.ts |
Root Vitest config |
docker/docker-compose.yml |
Test database containers |
Engine pinning
@prisma/engines-version— pinned viadependenciesin many packages@prisma/engines— runtime download wrapper (postinstall)- Override via
packages/fetch-engine/package.jsonenginesOverride(see Custom engines)
See also
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.