Closed amallek closed 1 year ago
I expect you're using a .env
file? This is fixed on main
and will be released soon, since I now use dotenv
rather than std::env
.
That's correct. Thanks; looking forward to the release.
Also just encountered this issue, looking forward to the release!
I've just encountered this issue. Seems like it still panics when the .env file is in the prisma/ folder. It works fine when it's in the root folder though.
@FlucTuAteDev .env
files in the prisma
folder won't be detected, they have to be in the same folder as you run the cli/your application from.
Oh, okay. I might have missed that. The official docs says that it can be located there. Also when running cargo prisma generate it says that it loaded the envs from the prisma folder:
Environment variables loaded from prisma\.env
Prisma schema loaded from prisma\schema.prisma
✔ Generated Prisma Client Rust to .\src\prisma.rs in 361ms
Bug description
With the current version 0.6.6 it is indeed possible to create the
prisma.rs
with the help ofprisma generate
, if you useenv("DATABASE_URL")
as database URL inschema.prisma
:However, it is unfortunately not possible to run cargo run/build. The following error occurs:
With RUST_BACKTRACE=1:
How to reproduce
Use
in
prisma.schema
and try to runcargo build
to reproduce. This will produce the error above.Change back to
and
cargo build
works wellExpected behavior
It would be handy if env() was supported consistently.
Prisma information
Environment & setup
OS: MacOS Database: Postgres