Skip to content

Commit c3771ee

Browse files
authored
doc(prisma-config): update example using environment variables (#7203)
1 parent dba7ffd commit c3771ee

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

content/200-orm/500-reference/325-prisma-config-reference.mdx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,28 @@ export default {} satisfies PrismaConfig;
356356

357357
### Using environment variables
358358

359-
When using `prisma.config.ts`, environment variables from `.env` files are not automatically loaded. You'll need to:
359+
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:
360+
361+
1. Pass a `--env-file` flag to the command line
362+
363+
<TabbedContent code>
364+
<TabItem value="Node">
365+
```terminal
366+
node --env-file=.env index.js
367+
node --env-file=.env --env-file=.local.env index.js
368+
```
369+
</TabItem>
370+
<TabItem value="Deno">
371+
```terminal
372+
deno run --env-file main.ts
373+
deno run --env-file=.env --env-file=.local.env main.ts
374+
```
375+
</TabItem>
376+
</TabbedContent>
377+
378+
For Bun, `.env` files are automatically loaded.
379+
380+
For releases of Node before v20, you'll need to:
360381

361382
1. Install the `dotenv` package:
362383

0 commit comments

Comments
 (0)