Skip to content
This repository was archived by the owner on Jan 14, 2021. It is now read-only.
This repository was archived by the owner on Jan 14, 2021. It is now read-only.

Prisma Client should pick up required env vars from .env file during development #454

@schickling

Description

@schickling

Context

We currently encourage users to hardcode their DB credentials into the schema.prisma by this being the default getting started experience. We should strongly discourage developers to do so and therefore adjust our getting started experience + examples accordingly in order to encourage the use of environment variables.

In order to not degrade the DX during local development, I'm suggesting the following change in Prisma Client.

Proposal

  • Prisma Client should auto-import required env vars (i.e. env vars referenced in the Prisma schema in the datasource.url property) from the .env file during development.
    • Implementation notes: It's important that this functionality/feature takes the lowest precedent (i.e. if the user provides their own env vars, call require('dotenv') or similar themselves, this feature shouldn't conflict in any way)
    • It should not make the env vars available to the entire Node process but just the query engine.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions