Skip to content

feat!: remove env loading and dotenv support - #28298

Merged
aqrln merged 1 commit into
nextfrom
push-svxonmzrnypx
Nov 3, 2025
Merged

feat!: remove env loading and dotenv support#28298
aqrln merged 1 commit into
nextfrom
push-svxonmzrnypx

Conversation

@aqrln

@aqrln aqrln commented Oct 14, 2025

Copy link
Copy Markdown
Member

Since Prisma Client won't be aware of connection strings anymore (except when using Accelerate), this logic is mostly obsolete.

We wanted to remove loading dotenv regardless, and have people load their environment variables themselves, as it shouldn't be Prisma's responsibility and Prisma shouldn't be mutating process.env. However, this PR takes it one step further, and disables evaluating and validating the value of env() for the url property in PSL altogether (except in LibraryEngine, where the environment variables are still passed to the engine).

Ref: prisma/prisma-engines#5681
Ref: https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prismaclient
Closes: https://linear.app/prisma-company/issue/TML-309/fix-leaky-env-logic-→-stop-mutating-processenv
Closes: #19519

@aqrln aqrln added this to the 7.0.0 milestone Oct 14, 2025
@aqrln
aqrln force-pushed the push-svxonmzrnypx branch 2 times, most recently from caaf79d to 54a5298 Compare October 15, 2025 15:58
@aqrln
aqrln force-pushed the push-svxonmzrnypx branch from 54a5298 to d0f5cde Compare October 30, 2025 10:31
@aqrln
aqrln changed the base branch from next to push-rltyqkkoomox October 30, 2025 10:31
@aqrln
aqrln force-pushed the push-svxonmzrnypx branch 2 times, most recently from 3903ff1 to fbc8b8e Compare October 30, 2025 15:57
@github-actions

github-actions Bot commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
packages/client/runtime/library.js 137.16 KB (-5.84% 🔽)
packages/client/runtime/library.d.ts 111.95 KB (-0.69% 🔽)
packages/client/runtime/index-browser.js 2.23 KB (0%)
packages/client/runtime/index-browser.d.ts 3.28 KB (0%)
packages/cli/build/index.js 2.17 MB (-0.64% 🔽)
packages/client/prisma-client-0.0.0.tgz 11.27 MB (-0.47% 🔽)
packages/cli/prisma-0.0.0.tgz 9.43 MB (-0.68% 🔽)
packages/bundle-size/da-workers-libsql/output.tgz 848.43 KB (-0.01% 🔽)
packages/bundle-size/da-workers-neon/output.tgz 903.15 KB (-0.01% 🔽)
packages/bundle-size/da-workers-pg/output.tgz 895.1 KB (-0.01% 🔽)
packages/bundle-size/da-workers-planetscale/output.tgz 848.66 KB (-0.02% 🔽)
packages/bundle-size/da-workers-d1/output.tgz 831.36 KB (-0.01% 🔽)

@aqrln aqrln changed the title feat!: remove dotenv support from Prisma Client feat!: remove env loading and dotenv support Oct 31, 2025
@aqrln
aqrln force-pushed the push-svxonmzrnypx branch 9 times, most recently from 66f6069 to 7ae4a5e Compare October 31, 2025 16:06
@aqrln
aqrln marked this pull request as ready for review October 31, 2025 16:06
@aqrln
aqrln force-pushed the push-svxonmzrnypx branch from 7ae4a5e to a3e2fac Compare October 31, 2025 16:07
@aqrln
aqrln force-pushed the push-rltyqkkoomox branch from 014debd to 98db971 Compare October 31, 2025 16:07
@aqrln
aqrln force-pushed the push-svxonmzrnypx branch from a3e2fac to 9881e1e Compare October 31, 2025 17:33
Comment thread packages/client/tests/functional/_utils/config-builder.ts Outdated

@jacek-prisma jacek-prisma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with one very minor comment

@aqrln
aqrln force-pushed the push-svxonmzrnypx branch from 9881e1e to 7b05f37 Compare November 3, 2025 11:11
Base automatically changed from push-rltyqkkoomox to next November 3, 2025 12:07
aqrln added a commit to prisma/prisma-engines that referenced this pull request Nov 3, 2025
Don't load or validate the `url` attribute from the `datasource` block
in `get_config`.

It isn't fully removed yet, but it is now essentially ignored everywhere
except Query Engine.

Ref: prisma/orm#28298
Ref:
https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prismaclient
Ref:
https://linear.app/prisma-company/issue/TML-1545/remove-url-datasource-attribute-from-psl

/prisma-branch push-svxonmzrnypx
Since there's no `env()` in PSL anymore, we don't need to load
environment variables in Prisma Client.

But we also wanted to remove this logic regardless and have people load
their environment variables themselves, as it shouldn't be Prisma's
responsibility and Prisma shouldn't be mutating `process.env`.

This is already the case for the new generator, now we remove this
completely.

Ref: https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prismaclient
Ref: https://linear.app/prisma-company/issue/TML-1340/remove-env-from-psl
Closes: https://linear.app/prisma-company/issue/TML-309/fix-leaky-env-logic-→-stop-mutating-processenv
@aqrln
aqrln force-pushed the push-svxonmzrnypx branch from 7b05f37 to 339f36b Compare November 3, 2025 12:09
@aqrln
aqrln merged commit c6feff4 into next Nov 3, 2025
258 of 259 checks passed
@aqrln
aqrln deleted the push-svxonmzrnypx branch November 3, 2025 12:48
aqrln added a commit that referenced this pull request Nov 5, 2025
Remove obsolete `injectableEdgeEnv`. This was missed in
#28411 and
#28298.
aqrln added a commit to prisma/prisma-engines that referenced this pull request Nov 17, 2025
Don't load or validate the `url` attribute from the `datasource` block
in `get_config`.

It isn't fully removed yet, but it is now essentially ignored everywhere
except Query Engine.

Ref: prisma/orm#28298
Ref:
https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prismaclient
Ref:
https://linear.app/prisma-company/issue/TML-1545/remove-url-datasource-attribute-from-psl

/prisma-branch push-svxonmzrnypx
aqrln added a commit to prisma/prisma-engines that referenced this pull request Nov 17, 2025
Don't load or validate the `url` attribute from the `datasource` block
in `get_config`.

It isn't fully removed yet, but it is now essentially ignored everywhere
except Query Engine.

Ref: prisma/orm#28298
Ref:
https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prismaclient
Ref:
https://linear.app/prisma-company/issue/TML-1545/remove-url-datasource-attribute-from-psl

/prisma-branch push-svxonmzrnypx
aqrln added a commit to prisma/prisma-engines that referenced this pull request Nov 17, 2025
Don't load or validate the `url` attribute from the `datasource` block
in `get_config`.

It isn't fully removed yet, but it is now essentially ignored everywhere
except Query Engine.

Ref: prisma/orm#28298
Ref:
https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prismaclient
Ref:
https://linear.app/prisma-company/issue/TML-1545/remove-url-datasource-attribute-from-psl

/prisma-branch push-svxonmzrnypx
aqrln added a commit that referenced this pull request Nov 17, 2025
Since Prisma Client won't be aware of connection strings anymore (except
when using Accelerate), this logic is mostly obsolete.

We wanted to remove loading `dotenv` regardless, and have people load
their environment variables themselves, as it shouldn't be Prisma's
responsibility and Prisma shouldn't be mutating `process.env`. However,
this PR takes it one step further, and disables evaluating and
validating the value of `env()` for the `url` property in PSL altogether
(except in `LibraryEngine`, where the environment variables are still
passed to the engine).

Ref: prisma/prisma-engines#5681
Ref:
https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prismaclient
Closes:
https://linear.app/prisma-company/issue/TML-309/fix-leaky-env-logic-→-stop-mutating-processenv
Closes: #19519
aqrln added a commit that referenced this pull request Nov 17, 2025
Remove obsolete `injectableEdgeEnv`. This was missed in
#28411 and
#28298.
aqrln added a commit that referenced this pull request Nov 17, 2025
Since Prisma Client won't be aware of connection strings anymore (except
when using Accelerate), this logic is mostly obsolete.

We wanted to remove loading `dotenv` regardless, and have people load
their environment variables themselves, as it shouldn't be Prisma's
responsibility and Prisma shouldn't be mutating `process.env`. However,
this PR takes it one step further, and disables evaluating and
validating the value of `env()` for the `url` property in PSL altogether
(except in `LibraryEngine`, where the environment variables are still
passed to the engine).

Ref: prisma/prisma-engines#5681
Ref:
https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prismaclient
Closes:
https://linear.app/prisma-company/issue/TML-309/fix-leaky-env-logic-→-stop-mutating-processenv
Closes: #19519
aqrln added a commit that referenced this pull request Nov 17, 2025
Remove obsolete `injectableEdgeEnv`. This was missed in
#28411 and
#28298.
aqrln added a commit that referenced this pull request Nov 17, 2025
Since Prisma Client won't be aware of connection strings anymore (except
when using Accelerate), this logic is mostly obsolete.

We wanted to remove loading `dotenv` regardless, and have people load
their environment variables themselves, as it shouldn't be Prisma's
responsibility and Prisma shouldn't be mutating `process.env`. However,
this PR takes it one step further, and disables evaluating and
validating the value of `env()` for the `url` property in PSL altogether
(except in `LibraryEngine`, where the environment variables are still
passed to the engine).

Ref: prisma/prisma-engines#5681
Ref:
https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prismaclient
Closes:
https://linear.app/prisma-company/issue/TML-309/fix-leaky-env-logic-→-stop-mutating-processenv
Closes: #19519
aqrln added a commit that referenced this pull request Nov 17, 2025
Remove obsolete `injectableEdgeEnv`. This was missed in
#28411 and
#28298.
aqrln added a commit to prisma/prisma-engines that referenced this pull request Nov 17, 2025
Don't load or validate the `url` attribute from the `datasource` block
in `get_config`.

It isn't fully removed yet, but it is now essentially ignored everywhere
except Query Engine.

Ref: prisma/orm#28298
Ref:
https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prismaclient
Ref:
https://linear.app/prisma-company/issue/TML-1545/remove-url-datasource-attribute-from-psl

/prisma-branch push-svxonmzrnypx
Aijeyomah pushed a commit to Aijeyomah/prisma-engines that referenced this pull request Jan 26, 2026
Don't load or validate the `url` attribute from the `datasource` block
in `get_config`.

It isn't fully removed yet, but it is now essentially ignored everywhere
except Query Engine.

Ref: prisma/orm#28298
Ref:
https://linear.app/prisma-company/issue/TML-1459/remove-processenv-loading-from-prismaclient
Ref:
https://linear.app/prisma-company/issue/TML-1545/remove-url-datasource-attribute-from-psl

/prisma-branch push-svxonmzrnypx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants