drizzle-team / drizzle-team/drizzle-orm

[DOCS]: Remove calling `dotenv` in `drizzle.config.ts`

Open
#5,725 2 comments 1 reaction 0 assignees View on GitHub
docs
Dominant language
TypeScript
Stars
35.8k
Forks
1.6k
Avg merge
2d 7h
Merged PRs (30d)
4

Description

### Enhancement hasn't been filed before.

- [x] I have verified this enhancement I'm about to request hasn't been suggested before.

### Describe the enhancement you want to request

> Environment variables are now fetched automatically
>
> As mentioned many times, you can finally skip fetching environment variables to use with the drizzle.config file. Drizzle Kit will handle this process automatically.

https://github.com/drizzle-team/drizzle-kit-mirror/releases/tag/v0.20.0

```ts
// drizzle.config.ts
import { config } from 'dotenv';
import { defineConfig } from 'drizzle-kit';

config({ path: '.env' }); // this seems unnecessary

export default defineConfig({
schema: './src/db/schema.ts',
out: './migrations',
dialect: 'turso',
dbCredentials: {
url: process.env.TURSO_CONNECTION_URL!,
authToken: process.env.TURSO_AUTH_TOKEN!,
},
});
```

```diff
- config({ path: '.env' });
```

https://orm.drizzle.team/docs/tutorials/drizzle-with-turso#setup-drizzle-config-file

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.