Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion content/200-orm/500-reference/325-prisma-config-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,28 @@ export default {} satisfies PrismaConfig;

### Using environment variables

When using `prisma.config.ts`, environment variables from `.env` files are not automatically loaded. You'll need to:
When using `prisma.config.ts`, environment variables from `.env` files are not automatically loaded. If you're using node or deno, you'll need to:

1. Pass a `--env-file` flag to the command line

<TabbedContent code>
<TabItem value="Node">
```terminal
node --env-file=.env index.js
node --env-file=.env --env-file=.local.env index.js
```
</TabItem>
<TabItem value="Deno">
```terminal
deno run --env-file main.ts
deno run --env-file=.env --env-file=.local.env main.ts
```
</TabItem>
</TabbedContent>

For Bun, `.env` files are automatically loaded.

For releases of Node before v20, you'll need to:

1. Install the `dotenv` package:

Expand Down
Loading