-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Environment variables loaded from .env" is misleading #10104
Comments
I think what technically is happening there that Prisma does read from
This is unfortunately not possible, as Prisma itself das not read Does that make sense? Still I totally see how this can be confusing. |
ping @bennycode |
Hi @janpio, your explanation makes sense to me. I think the best that can be done here is placing a note in the docs. And how about rephrasing "Environment variables loaded from .env" to just "Environment variables loaded"? |
The correct wording would probably be |
It's super misleading, I lost two hours trying to figure out why my env variables from Actually dotenv and prisma aren't smart at all: if you have the same variable in the two files and used
|
Any news on this? |
The problem is the advice to use For example: |
Just got bitten by this. I wouldn't expect prisma to expand |
@janpio is there any reason prisma is integrating |
Same for me, we got kinda fucked by this. Totally unexpected behavior. |
What would be an acceptable fix? I figure that Prisma should (1) not
overload process.env (2) by default, use a different *.prisma.env file (3)
accept a CLI PRISMA_ENV override that is the path to the desired prima env
file.
I can open a PR, but as it is a breaking change, feel that it would be
rejected even though it is the safe behavior.
…On Tue, Nov 28, 2023 at 2:23 AM Dawid Moczadlo ***@***.***> wrote:
Same for me, we got kinda fucked by this. Totally unexpected behavior.
—
Reply to this email directly, view it on GitHub
<#10104 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACESLNJTVZV2X5MOFIUGM3YGW3QJAVCNFSM5HLGAJHKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBSHE2TEMJUGA2A>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
i am using render.com for postgresql but when i want to migrate to db i get this: Environment variables loaded from .env Error: P1001: Can't reach database server at Please make sure your database server is running at can anyone tell me what is the problem? |
Bug description
I followed the "Running migrations on different environments" guide and executed this statement in my terminal:
It was giving me the following output:
I was very surprised because I do have a
.env
and.env.test
file in my project and thought that Pisma is not pickung up my.env.test
file because it's reporting that it loaded variables from ".env". In fact it used my.env.test
file.How to reproduce
.env
file withDATABASE_URL="postgresql://postgres:postgres@localhost:5432/root_db?schema=public"
.env.test
file withDATABASE_URL="postgresql://prisma:prisma@localhost:5433/test_db?schema=public"
dotenv -e .env.test -- npx prisma migrate dev
Expected behavior
To avoid this confusion I suggest to change the phrasing of the console output. Preferably it should show the correct file name (e.g. loaded from .env.test) or not mention the file name at all (e.g. loaded environment variables).
Prisma information
schema.prisma
Environment & setup
Prisma Version
The text was updated successfully, but these errors were encountered: