Skip to content

Commit e35e705

Browse files
DC-5044 prisma-client-js deprecated (#7219)
* `prisma-client-js` deprecated * chore: empty commit * broken link updated
1 parent 67ed4ac commit e35e705

File tree

2 files changed

+75
-72
lines changed

2 files changed

+75
-72
lines changed

content/200-orm/100-prisma-schema/10-overview/03-generators.mdx

Lines changed: 74 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -15,79 +15,10 @@ generator client {
1515

1616
A generator determines which assets are created when you run the `prisma generate` command.
1717

18-
There are two generators for Prisma Client:
19-
20-
- `prisma-client` (recommended): Newer and more flexible version of `prisma-client-js` with ESM support; it outputs plain TypeScript code and _requires_ a custom `output` path (read more about it [here](https://www.prisma.io/blog/why-prisma-orm-generates-code-into-node-modules-and-why-it-ll-change))
21-
- `prisma-client-js`: Generates Prisma Client into `node_modules`
18+
The default generator for Prisma Client is `prisma-client`, which outputs plain TypeScript code and _requires_ a custom `output` path (read more about it [here](https://www.prisma.io/blog/why-prisma-orm-generates-code-into-node-modules-and-why-it-ll-change)).
2219

2320
Alternatively, you can configure any npm package that complies with our generator specification.
2421

25-
## `prisma-client-js`
26-
27-
The `prisma-client-js` is the default generator for Prisma ORM 6.X versions and before. It requires the `@prisma/client` npm package and generates Prisma Client into `node_modules`.
28-
29-
### Field reference
30-
31-
The generator for Prisma's JavaScript Client accepts multiple additional properties:
32-
33-
- `previewFeatures`: [Preview features](/orm/reference/preview-features) to include
34-
- `binaryTargets`: Engine binary targets for `prisma-client-js` (for example, `debian-openssl-1.1.x` if you are deploying to Ubuntu 18+, or `native` if you are working locally)
35-
36-
```prisma
37-
generator client {
38-
provider = "prisma-client-js"
39-
previewFeatures = ["sample-preview-feature"]
40-
binaryTargets = ["debian-openssl-1.1.x"] // defaults to `"native"`
41-
}
42-
```
43-
44-
### Binary targets
45-
46-
:::note
47-
48-
As of [v6.16.0](https://pris.ly/release/6.16.0), Prisma ORM can be used without Rust engines in production applications. Learn more [here](/orm/prisma-client/setup-and-configuration/no-rust-engine).
49-
50-
**When enabled, your Prisma Client will be generated without a Rust-based query engine binary**:
51-
52-
```prisma
53-
generator client {
54-
provider = "prisma-client-js" // or "prisma-client"
55-
output = "../src/generated/prisma"
56-
engineType = "client" // no Rust engine
57-
}
58-
```
59-
60-
Note that [driver adapters](/orm/overview/databases/database-drivers#driver-adapters) are required if you want to use Prisma ORM without Rust engines.
61-
62-
When using Prisma ORM without Rust, the `binaryTargets` field is obsolete and not needed.
63-
64-
You can [read about the performance and DX improvements](https://www.prisma.io/blog/prisma-orm-without-rust-latest-performance-benchmarks) of this change on our blog.
65-
66-
:::
67-
68-
The `prisma-client-js` generator uses several [engines](https://github.com/prisma/prisma-engines). Engines are implemented in Rust and are used by Prisma Client in the form of executable, platform-dependent engine files. Depending on which platform you are executing your code on, you need the correct file. "Binary targets" are used to define which files should be present for the target platform(s).
69-
70-
The correct file is particularly important when [deploying](/orm/prisma-client/deployment/deploy-prisma) your application to production, which often differs from your local development environment.
71-
72-
#### The `native` binary target
73-
74-
The `native` binary target is special. It doesn't map to a concrete operating system. Instead, when `native` is specified in `binaryTargets`, Prisma Client detects the _current_ operating system and automatically specifies the correct binary target for it.
75-
76-
As an example, assume you're running **macOS** and you specify the following generator:
77-
78-
```prisma file=prisma/schema.prisma
79-
generator client {
80-
provider = "prisma-client-js"
81-
binaryTargets = ["native"]
82-
}
83-
```
84-
85-
In that case, Prisma Client detects your operating system and finds the right binary file for it based on the [list of supported operating systems](/orm/reference/prisma-schema-reference#binarytargets-options) .
86-
If you use macOS Intel x86 (`darwin`), then the binary file that was compiled for `darwin` will be selected.
87-
If you use macOS ARM64 (`darwin-arm64`), then the binary file that was compiled for `darwin-arm64` will be selected.
88-
89-
> **Note**: The `native` binary target is the default. You can set it explicitly if you wish to include additional [binary targets](/orm/reference/prisma-schema-reference#binarytargets-options) for deployment to different environments.
90-
9122
## `prisma-client`
9223

9324
The new `prisma-client` generator offers greater control and flexibility when using Prisma ORM across different JavaScript environments (such as ESM, Bun, Deno, ...).
@@ -104,7 +35,7 @@ Here are the main differences compared to `prisma-client-js`:
10435
- More flexible thanks to additional [fields](#field-reference)
10536
- Outputs plain TypeScript that's bundled just like the rest of your application code
10637

107-
The `prisma-client` generator has been Generally Available since [v6.16.0](https://pris.ly/releases/6.16.0) will become the new default with Prisma ORM v7.
38+
The `prisma-client` generator has been Generally Available since [v6.16.0](https://pris.ly/releases/6.16.0) and is the default generator as of Prisma ORM v7.
10839

10940
### Getting started
11041

@@ -396,6 +327,78 @@ To see what the new `prisma-client` generator looks like in practice, check out
396327
| [`bun`](https://github.com/prisma/prisma-examples/tree/latest/generator-prisma-client/deno-deploy) | None | None | Deno 2 | n/a |
397328
| [`deno`](https://github.com/prisma/prisma-examples/tree/latest/generator-prisma-client/deno-deploy) | None | None | Deno 2 | n/a |
398329

330+
## `prisma-client-js` (Deprecated)
331+
332+
:::warning Deprecated
333+
334+
The `prisma-client-js` generator is **deprecated as of Prisma 7**. It was the default generator for Prisma ORM 6.X and earlier versions. We recommend migrating to [`prisma-client`](#prisma-client) for new projects and updating existing projects when possible.
335+
336+
:::
337+
338+
The `prisma-client-js` generator requires the `@prisma/client` npm package and generates Prisma Client into `node_modules`.
339+
340+
### Field reference
341+
342+
The generator for Prisma's JavaScript Client accepts multiple additional properties:
343+
344+
- `previewFeatures`: [Preview features](/orm/reference/preview-features) to include
345+
- `binaryTargets`: Engine binary targets for `prisma-client-js` (for example, `debian-openssl-1.1.x` if you are deploying to Ubuntu 18+, or `native` if you are working locally)
346+
347+
```prisma
348+
generator client {
349+
provider = "prisma-client-js"
350+
previewFeatures = ["sample-preview-feature"]
351+
binaryTargets = ["debian-openssl-1.1.x"] // defaults to `"native"`
352+
}
353+
```
354+
355+
### Binary targets
356+
357+
:::note
358+
359+
As of [v6.16.0](https://pris.ly/release/6.16.0), Prisma ORM can be used without Rust engines in production applications. Learn more [here](/orm/prisma-client/setup-and-configuration/no-rust-engine).
360+
361+
**When enabled, your Prisma Client will be generated without a Rust-based query engine binary**:
362+
363+
```prisma
364+
generator client {
365+
provider = "prisma-client-js" // or "prisma-client"
366+
output = "../src/generated/prisma"
367+
engineType = "client" // no Rust engine
368+
}
369+
```
370+
371+
Note that [driver adapters](/orm/overview/databases/database-drivers#driver-adapters) are required if you want to use Prisma ORM without Rust engines.
372+
373+
When using Prisma ORM without Rust, the `binaryTargets` field is obsolete and not needed.
374+
375+
You can [read about the performance and DX improvements](https://www.prisma.io/blog/prisma-orm-without-rust-latest-performance-benchmarks) of this change on our blog.
376+
377+
:::
378+
379+
The `prisma-client-js` generator uses several [engines](https://github.com/prisma/prisma-engines). Engines are implemented in Rust and are used by Prisma Client in the form of executable, platform-dependent engine files. Depending on which platform you are executing your code on, you need the correct file. "Binary targets" are used to define which files should be present for the target platform(s).
380+
381+
The correct file is particularly important when [deploying](/orm/prisma-client/deployment/deploy-prisma) your application to production, which often differs from your local development environment.
382+
383+
#### The `native` binary target
384+
385+
The `native` binary target is special. It doesn't map to a concrete operating system. Instead, when `native` is specified in `binaryTargets`, Prisma Client detects the _current_ operating system and automatically specifies the correct binary target for it.
386+
387+
As an example, assume you're running **macOS** and you specify the following generator:
388+
389+
```prisma file=prisma/schema.prisma
390+
generator client {
391+
provider = "prisma-client-js"
392+
binaryTargets = ["native"]
393+
}
394+
```
395+
396+
In that case, Prisma Client detects your operating system and finds the right binary file for it based on the [list of supported operating systems](/orm/reference/prisma-schema-reference#binarytargets-options) .
397+
If you use macOS Intel x86 (`darwin`), then the binary file that was compiled for `darwin` will be selected.
398+
If you use macOS ARM64 (`darwin-arm64`), then the binary file that was compiled for `darwin-arm64` will be selected.
399+
400+
> **Note**: The `native` binary target is the default. You can set it explicitly if you wish to include additional [binary targets](/orm/reference/prisma-schema-reference#binarytargets-options) for deployment to different environments.
401+
399402
## Community generators
400403

401404
:::note

content/200-orm/500-reference/100-prisma-schema-reference.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Defines a [generator](/orm/prisma-schema/overview/generators) in the Prisma sche
161161

162162
### Fields for `prisma-client-js` provider
163163

164-
This is the default generator for Prisma ORM 6.x and earlier versions. Learn more about [generators](/orm/prisma-schema/overview/generators#prisma-client-js).
164+
This is the default generator for Prisma ORM 6.x and earlier versions. Learn more about [generators](/orm/prisma-schema/overview/generators#prisma-client-js-deprecated).
165165

166166
A `generator` block accepts the following fields:
167167

0 commit comments

Comments
 (0)