-
Notifications
You must be signed in to change notification settings - Fork 1k
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
fix(deps): update prisma monorepo to v5.14.0 #10627
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Josh-Walker-GM
pushed a commit
that referenced
this pull request
May 17, 2024
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@prisma/client](https://www.prisma.io) ([source](https://github.com/prisma/prisma/tree/HEAD/packages/client)) | [`5.11.0` -> `5.14.0`](https://renovatebot.com/diffs/npm/@prisma%2fclient/5.11.0/5.14.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@prisma%2fclient/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@prisma%2fclient/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@prisma%2fclient/5.11.0/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@prisma%2fclient/5.11.0/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@prisma/internals](https://www.prisma.io) ([source](https://github.com/prisma/prisma/tree/HEAD/packages/internals)) | [`5.11.0` -> `5.14.0`](https://renovatebot.com/diffs/npm/@prisma%2finternals/5.11.0/5.14.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@prisma%2finternals/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@prisma%2finternals/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@prisma%2finternals/5.11.0/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@prisma%2finternals/5.11.0/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [prisma](https://www.prisma.io) ([source](https://github.com/prisma/prisma/tree/HEAD/packages/cli)) | [`5.11.0` -> `5.14.0`](https://renovatebot.com/diffs/npm/prisma/5.11.0/5.14.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/prisma/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/prisma/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/prisma/5.11.0/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/prisma/5.11.0/5.14.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- <details> <summary>prisma/prisma (@​prisma/client)</summary> [Compare Source](https://github.com/prisma/prisma/compare/5.13.0...5.14.0) Today, we are excited to share the `5.14.0` stable release 🎉 🌟 **Help us spread the word about Prisma by starring the repo ☝️ or [posting on X](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@​prisma%20release%20v5.14.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.14.0) about the release.** 🌟 We want to know how you like working with Prisma ORM in your projects! Please [take our 2min survey](https://pris.ly/orm/survey/release-5-14) and let us know what you like or where we can improve 🙏 We’re happy to announce the availability of a new, top-level Prisma Client query: `createManyAndReturn()`. It works similarly to `createMany()` but uses a `RETURNING` clause in the SQL query to retrieve the records that were just created. Here’s an example of creating multiple posts and then immediately returning those posts. ```tsx const postBodies = req.json()['posts'] const posts = prisma.post.createManyAndReturn({ data: postBodies }); return posts ``` Additionally,`createManyAndReturn()` supports the same options as `findMany()`, such as the ability to return only specific fields. ```tsx const postBodies = req.json()['posts'] const postTitles = prisma.post.createManyAndReturn({ data: postBodies, select: { title: true, }, }); return postTitles ``` **Note**: Because `createManyAndReturn()` uses the `RETURNING` clause, it is only supported by PostgreSQL, CockroachDB, and SQLite databases. At this time, `relationLoadStrategy: join` is not supported in `createManyAndReturn()` queries. Previously, Prisma ORM suffered from performance issues when using the `in` operator or when including related models in queries against a MongoDB database. These queries were translated by the Prisma query engine in such a way that indexes were skipped and collection scans were used, leading to slower queries especially on large datasets. With 5.14.0, Prisma ORM now rewrites queries to use a combination of `$or` and `$eq` operators, leading to dramatic performance increases for queries that include `in` operators or relation loading. - [`createMany()` should return the created records](https://github.com/prisma/prisma/issues/8131) - [Generating Prisma client without any model in its schema](https://github.com/prisma/prisma/issues/11582) - [MongoDB: Performance issue with nested `take` on many-to-one relationship](https://github.com/prisma/prisma/issues/13865) - [Slow queries on MongoDB using `include` for relations](https://github.com/prisma/prisma/issues/15156) - [\[MongoDB\] Performance issue in `findMany()` query execution with `in`](https://github.com/prisma/prisma/issues/15983) - [MongoDB nested/`include` query slow](https://github.com/prisma/prisma/issues/17142) - [MongoDB Connector generates queries which do not take advantage of indices.](https://github.com/prisma/prisma/issues/17396) - [Mongodb Nested Queries Not Using Indexes](https://github.com/prisma/prisma/issues/18025) - [MongoDB slow delete with `onDelete: SetNull`](https://github.com/prisma/prisma/issues/19169) - [Slow query with many-to-one relationship on MongoDB](https://github.com/prisma/prisma/issues/20600) - [`prisma init --with-model`](https://github.com/prisma/prisma/issues/20915) - [Fixed version of `@opentelemetry/*` dependencies](https://github.com/prisma/prisma/issues/21473) - [Usage of deprecated punycode module](https://github.com/prisma/prisma/issues/21644) - [Bug: D1 One-to-Many Relation INSERTs fail with `The required connected records were not found.` when using indices](https://github.com/prisma/prisma/issues/23902) - [Empty `dbgenerated()` still breaking for `Unsupported()` types](https://github.com/prisma/prisma/issues/15654) - [Validation error when `shadowDatabaseUrl` is identical to `url` (or `directUrl`)](https://github.com/prisma/prisma/issues/16628) - [MongoDB Query with 'in' condition will cause COLLSCAN, without leveraging indexes](https://github.com/prisma/prisma/issues/19955) - ["Not Authorised" when directly applying Prisma generated migrations to Cloudflare D1 with `PRAGMA foreign_key_check;`](https://github.com/prisma/prisma/issues/23827) - [make superior: model generate](https://github.com/prisma/language-tools/issues/1651) - [Missing code autocomplete for referential actions with mongodb](https://github.com/prisma/language-tools/issues/1676) Curious about all things Prisma? Be sure to check out the [Prisma Changelog](https://www.prisma.io/changelog) for updates across Prisma's products, including ORM, Accelerate, and Pulse! Huge thanks to [@​pranayat](https://github.com/pranayat), [@​yubrot](https://github.com/yubrot), [@​skyzh](https://github.com/skyzh), [@​anuraaga](https://github.com/anuraaga), [@​gutyerrez](https://github.com/gutyerrez), [@​avallete](https://github.com/avallete), [@​ceddy4395](https://github.com/ceddy4395), [@​Kayoshi-dev](https://github.com/Kayoshi-dev) for helping! [Compare Source](https://github.com/prisma/prisma/compare/5.12.1...5.13.0) Today, we are excited to share the `5.13.0` stable release 🎉 🌟 **Help us spread the word about Prisma by starring the repo or [posting on X](https://twitter.com/intent/post?text=Check%20out%20the%20latest%20%40prisma%20release%20v5.13.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps%3A%2F%2Fgit.luolix.top%2Fprisma%2Fprisma%2Freleases%2Ftag%2F5.13.0) about the release.** We’re excited to announce Preview support for the `omit` option within the Prisma Client query options. The [highly-requested](https://github.com/prisma/prisma/issues/5042) `omit` feature now allows you to exclude fields that you don’t want to retrieve from the database on a ***per-query basis*.** By default, when a query returns records, the result includes all scalar fields of the models defined in the Prisma schema. [`select`](https://www.prisma.io/docs/orm/reference/prisma-client-reference#select) can be used to return specific fields, while `omit` can now be used to exclude specific fields. `omit` lives at the same API level and works on all of the same [Prisma Client model queries](https://www.prisma.io/docs/orm/reference/prisma-client-reference#model-queries) as `select`. Note, however, that `omit` and `select` are mutually exclusive. In other words, you can’t use both in the same query. To get started using `omit`, enable the `omitApi` Preview feature in your Prisma schema: ```prisma // schema.prisma generator client { provider = "prisma-client-js" previewFeatures = ["omitApi"] } ``` Be sure to re-generate Prisma Client afterwards: ```bash npx prisma generate ``` Here is an example of using `omit`: ```ts // Includes all fields except password await prisma.user.findMany({ omit: { password: true }, }) ``` Here is an example of using `omit` with `include`: ```ts // Includes all user fields except user's password and title of user's posts await prisma.user.findMany({ omit: { password: true }, include: { posts: { omit: { title: true }, }, }, }) ``` <details> <summary>Expand to view the example Prisma schema</summary> ```prisma model User { id Int @​id @​default(autoincrement()) email String @​unique name String? password String posts Post[] } model Post { id Int @​id @​default(autoincrement()) title String author User @​relation(fields: [authorId], references: [id]) authorId Int } ``` </details> Many users have requested a global implementation of `omit`. This request will be accommodated in the future. In the meantime, you can follow the issue [here](https://github.com/prisma/prisma/issues/5042). **📣 Share your feedback:** [`omitApi` Preview feature](https://github.com/prisma/prisma/discussions/23924) **📚 Documentation:** [`omit` - Prisma Client API Reference](https://www.prisma.io/docs/orm/reference/prisma-client-reference#omit-preview) - [Nicer Datamodel Type validation](https://github.com/prisma/prisma/issues/15174) - [`✘ [ERROR] near "��": syntax error at offset 0` when running `wrangler d1 migrations apply` with Prisma generated migration (on Windows, using Powershell)](https://github.com/prisma/prisma/issues/23702) Huge thanks to [@​ospfranco](https://github.com/ospfranco), [@​pranayat](https://github.com/pranayat), [@​yubrot](https://github.com/yubrot), [@​skyzh](https://github.com/skyzh), [@​anuraaga](https://github.com/anuraaga), [@​yehonatanz](https://github.com/yehonatanz), [@​arthurfiorette](https://github.com/arthurfiorette), [@​elithrar](https://github.com/elithrar), [@​tockn](https://github.com/tockn), [@​Kuhave](https://github.com/Kuhave), [@​obiwac](https://github.com/obiwac) for helping! [Compare Source](https://github.com/prisma/prisma/compare/5.12.0...5.12.1) Today, we are issuing the `5.12.1` patch release to fix two small problems with our [new Cloudflare D1 support](https://www.prisma.io/blog/build-applications-at-the-edge-with-prisma-orm-and-cloudflare-d1-preview). `db pull` The flags `--from-local-d1` and `--to-local-d1` for `migrate diff` and `--local-d1` to `db pull` we added in 5.12.0 were not working as expected when running on Windows only. This is now fixed. 📚 **Documentation:** [Deploying a Cloudflare worker with D1 and Prisma ORM](https://prisma.io/docs/orm/overview/databases/cloudflare-d1#how-to-connect-to-d1-in-cloudflare-workers-or-cloudflare-pages) We added a new parameter `--output` to `migrate diff` that can be used to provide a filename into which the output of the command will be written. This is particularly useful for Windows users, using PowerShell, as using `>` to write into a file creates a UTF-16 LE file that can not be read by `wrangler d1 migrations apply`. Using this new option, this problem can be avoided: ```sh npx prisma migrate diff --script --from-empty --to-schema-datamodel ./prisma/schema.prisma --output ./schema.sql ``` Related issues: - [`✘ [ERROR] near "��": syntax error at offset 0` when running `wrangler d1 migrations apply` with Prisma generated migration (on Windows, using PowerShell) - `[prisma migrate resolve --applied` not working on new project, `migration ... could not be found.`]\[https://github.com/prisma/prisma/issues/17558](https://github.com/prisma/prisma/issues/17558)8) [Compare Source](https://github.com/prisma/prisma/compare/5.11.0...5.12.0) Today, we are excited to share the `5.12.0` stable release 🎉 🌟 **Help us spread the word about Prisma by starring the repo or [posting on X](https://twitter.com/intent/tweet?text=Check%20out%20the%20latest%20@​prisma%20release%20v5.12.0%20%F0%9F%9A%80%0D%0A%0D%0Ahttps://github.com/prisma/prisma/releases/tag/5.12.0) about the release.** This release brings Preview support for [Cloudflare D1](https://developers.cloudflare.com/d1/) with Prisma ORM 🥳 D1 is Cloudflare’s SQLite database that can be used when deploying applications with Cloudflare. When using Prisma ORM with D1, you can continue to: model your database with Prisma schema language, specify `sqlite` as your database provider in your Prisma schema, and interact with your database using Prisma Client. To use Prisma ORM and D1 on Cloudflare Workers or Cloudflare Pages, you need to set `sqlite` as your database provider and use the `@prisma/adapter-d1` database adapter via the `driverAdapters` Preview feature, released back in version [5.4.0](https://github.com/prisma/prisma/releases/tag/5.4.0). Here is an example of sending a query to your D1 database using Prisma Client in your Worker: ```ts // src/index.ts file import { PrismaClient } from '@​prisma/client' import { PrismaD1 } from '@​prisma/adapter-d1' // Add the D1Database to the Env interface export interface Env { // This must match the binding name defined in your wrangler.toml configuration DB: D1Database } export default { async fetch( request: Request, env: Env, ctx: ExecutionContext ): Promise<Response> { // Make sure the database name matches the binding name in wrangler.toml and Env interface const adapter = new PrismaD1(env.DB) // Instantiate PrismaClient using the PrismaD1 driver adapter const prisma = new PrismaClient({ adapter }) const users = await prisma.user.findMany() const result = JSON.stringify(users) return new Response(result) }, } ``` 📚 **Documentation:** [Deploying a Cloudflare worker with D1 and Prisma ORM](https://prisma.io/docs/orm/overview/databases/cloudflare-d1#how-to-connect-to-d1-in-cloudflare-workers-or-cloudflare-pages) ✍️ **Blog post:** [Build Applications at the Edge with Prisma ORM & Cloudflare D1 (Preview)](https://www.prisma.io/blog/build-applications-at-the-edge-with-prisma-orm-and-cloudflare-d1-preview) 📣 **Share your feedback:** [D1 Driver Adapter](https://github.com/prisma/prisma/discussions/23646) 🚀 **Example project:** [Deploy a Cloudflare Worker with D1](https://github.com/prisma/prisma-examples/tree/latest/deployment-platforms/edge/cloudflare-workers/with-d1) Bringing support for `createMany()` in SQLite has been a [long-awaited and highly requested feature](https://github.com/prisma/prisma/issues/10710) ⭐ `createMany()` is a method on Prisma Client, released back in version [2.16.0](https://github.com/prisma/prisma/releases/tag/2.16.0), that lets you insert multiple records into your database at once. This can be really useful when seeding your database or inserting bulk data. Here is an example of using `createMany()` to create new users: ```ts const users = await prisma.user.createMany({ data: [ { name: 'Sonali', email: 'sonali@prisma.io' }, { name: 'Alex', email: 'alex@prisma.io' }, { name: 'Yewande', email: 'yewande@prisma.io' }, { name: 'Angelina', email: 'angelina@prisma.io' }, ], }) ``` Before this release, if you wanted to perform bulk inserts with SQLite, you would have most likely used `$queryRawUnsafe` to execute raw SQL queries. But now you don’t have to go through all that trouble 🙂 With SQLite, `createMany()` works exactly the same way from an API standpoint as it does with other databases except it does not support the `skipDuplicates` option. At the behavior level, SQLite will split `createMany()` entries into multiple `INSERT` queries when the model in your schema contains fields with attributes like `@default(dbgenerated())` or `@default(autoincrement())` and when the fields are not consistently provided with values across the entries. 📚**Documentation:** [`createMany()` - Prisma Client API Reference](https://www.prisma.io/docs/orm/reference/prisma-client-reference#createmany) - [N+1 Issue with `Decimal` data type and combining queries (batching)](https://github.com/prisma/prisma/issues/5952) - [Batched `findUnique()` error out when the field is of `Boolean` type](https://github.com/prisma/prisma/issues/22384) - [`relationJoins` MySQL converts nested Decimal to float](https://github.com/prisma/prisma/issues/23233) - [Unexpected query leading to querying full table when using batched `findUnique()`](https://github.com/prisma/prisma/issues/23343) - [`node-postgres` (pg) errors with misleading `P2010 PrismaClientKnownRequestError` when using `@prisma/adapter-pg` with SSL (`?sslmode=require`)](https://github.com/prisma/prisma/issues/23390) - [D1 DateTime type does not work](https://github.com/prisma/prisma/issues/23479) Huge thanks to [@​yubrot](https://github.com/yubrot), [@​skyzh](https://github.com/skyzh), [@​anuraaga](https://github.com/anuraaga), [@​onichandame](https://github.com/onichandame), [@​LucianBuzzo](https://github.com/LucianBuzzo), [@​RobertCraigie](https://github.com/RobertCraigie), [@​arthurfiorette](https://github.com/arthurfiorette), [@​elithrar](https://github.com/elithrar) for helping! </details> --- 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/redwoodjs/redwood). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNjMuNSIsInVwZGF0ZWRJblZlciI6IjM3LjM2My41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
dac09
added a commit
that referenced
this pull request
May 17, 2024
…erverStore * 'main' of github.com:redwoodjs/redwood: (66 commits) fix(deps): update dependency @graphql-yoga/plugin-graphql-sse to v3.3.1 (#10639) fix(deps): update graphql-tools monorepo (#10641) fix(deps): update dependency core-js to v3.37.1 (#10630) fix(deps): update dependency @graphql-yoga/plugin-persisted-operations to v3.3.1 (#10640) fix(deps): update dependency @graphql-yoga/plugin-defer-stream to v3.3.1 (#10638) chore(deps): update dependency firebase to v10.12.0 (#10635) chore(deps): update yarn monorepo (#10624) fix(deps): update dependency @swc/core to v1.5.7 (#10634) fix(deps): update dependency mini-css-extract-plugin to v2.9.0 (#10633) fix(deps): update dependency @sdl-codegen/node to v0.0.15 (#10632) chore(deps): update dependency @npmcli/arborist to v7.5.2 (#10628) fix(deps): update dependency find-my-way to v8.2.0 (#10631) chore(deps): bump @fastify/reply-from from 9.4.0 to 9.8.0 (#10629) fix(deps): update prisma monorepo to v5.14.0 (#10627) fix(deps): update dependency fastify to v4.27.0 (#10625) fix(deps): update docusaurus monorepo to v3.3.2 (#10626) fix(deps): update dependency react-helmet-async to v2.0.5 (#10621) chore(deps): update dependency @types/vscode to v1.89.0 (#10623) fix(deps): update dependency react-hook-form to v7.51.4 (#10622) chore(deps): update dependency @clerk/clerk-react to v4.31.1 (#10616) ...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
changesets-ok
Override the changesets check
release:chore
This PR is a chore (means nothing for users)
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
5.11.0
->5.14.0
5.11.0
->5.14.0
5.11.0
->5.14.0
Release Notes
prisma/prisma (@prisma/client)
v5.14.0
Compare Source
Today, we are excited to share the
5.14.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo ☝️ or posting on X about the release. 🌟
Highlights
Share your feedback about Prisma ORM
We want to know how you like working with Prisma ORM in your projects! Please take our 2min survey and let us know what you like or where we can improve 🙏
createManyAndReturn()
We’re happy to announce the availability of a new, top-level Prisma Client query:
createManyAndReturn()
. It works similarly tocreateMany()
but uses aRETURNING
clause in the SQL query to retrieve the records that were just created.Here’s an example of creating multiple posts and then immediately returning those posts.
Additionally,
createManyAndReturn()
supports the same options asfindMany()
, such as the ability to return only specific fields.Note: Because
createManyAndReturn()
uses theRETURNING
clause, it is only supported by PostgreSQL, CockroachDB, and SQLite databases. At this time,relationLoadStrategy: join
is not supported increateManyAndReturn()
queries.MongoDB performance improvements
Previously, Prisma ORM suffered from performance issues when using the
in
operator or when including related models in queries against a MongoDB database. These queries were translated by the Prisma query engine in such a way that indexes were skipped and collection scans were used, leading to slower queries especially on large datasets.With 5.14.0, Prisma ORM now rewrites queries to use a combination of
$or
and$eq
operators, leading to dramatic performance increases for queries that includein
operators or relation loading.Fixes and improvements
Prisma Client
createMany()
should return the created recordstake
on many-to-one relationshipinclude
for relationsfindMany()
query execution within
include
query slowonDelete: SetNull
prisma init --with-model
@opentelemetry/*
dependenciesThe required connected records were not found.
when using indicesPrisma Migrate
dbgenerated()
still breaking forUnsupported()
typesshadowDatabaseUrl
is identical tourl
(ordirectUrl
)PRAGMA foreign_key_check;
Language tools (e.g. VS Code)
Company news
Prisma Changelog
Curious about all things Prisma? Be sure to check out the Prisma Changelog for updates across Prisma's products, including ORM, Accelerate, and Pulse!
Credits
Huge thanks to @pranayat, @yubrot, @skyzh, @anuraaga, @gutyerrez, @avallete, @ceddy4395, @Kayoshi-dev for helping!
v5.13.0
Compare Source
Today, we are excited to share the
5.13.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or posting on X about the release.
Highlights
omit
fields from Prisma Client queries (Preview)We’re excited to announce Preview support for the
omit
option within the Prisma Client query options. The highly-requestedomit
feature now allows you to exclude fields that you don’t want to retrieve from the database on a per-query basis.By default, when a query returns records, the result includes all scalar fields of the models defined in the Prisma schema.
select
can be used to return specific fields, whileomit
can now be used to exclude specific fields.omit
lives at the same API level and works on all of the same Prisma Client model queries asselect
. Note, however, thatomit
andselect
are mutually exclusive. In other words, you can’t use both in the same query.To get started using
omit
, enable theomitApi
Preview feature in your Prisma schema:Be sure to re-generate Prisma Client afterwards:
Here is an example of using
omit
:Here is an example of using
omit
withinclude
:Expand to view the example Prisma schema
Many users have requested a global implementation of
omit
. This request will be accommodated in the future. In the meantime, you can follow the issue here.📣 Share your feedback:
omitApi
Preview feature📚 Documentation:
omit
- Prisma Client API ReferenceFixes and improvements
Prisma Migrate
Prisma Client
✘ [ERROR] near "��": syntax error at offset 0
when runningwrangler d1 migrations apply
with Prisma generated migration (on Windows, using Powershell)Credits
Huge thanks to @ospfranco, @pranayat, @yubrot, @skyzh, @anuraaga, @yehonatanz, @arthurfiorette, @elithrar, @tockn, @Kuhave, @obiwac for helping!
v5.12.1
Compare Source
Today, we are issuing the
5.12.1
patch release to fix two small problems with our new Cloudflare D1 support.Fixes in Prisma CLI
Windows-only fix for new D1 specific flags for
migrate diff
anddb pull
The flags
--from-local-d1
and--to-local-d1
formigrate diff
and--local-d1
todb pull
we added in 5.12.0 were not working as expected when running on Windows only. This is now fixed.📚 Documentation: Deploying a Cloudflare worker with D1 and Prisma ORM
New option for
migrate diff
:-o
or--output
We added a new parameter
--output
tomigrate diff
that can be used to provide a filename into which the output of the command will be written. This is particularly useful for Windows users, using PowerShell, as using>
to write into a file creates a UTF-16 LE file that can not be read bywrangler d1 migrations apply
. Using this new option, this problem can be avoided:Related issues:
✘ [ERROR] near "��": syntax error at offset 0
when runningwrangler d1 migrations apply
with Prisma generated migration (on Windows, using PowerShell) #23702[prisma migrate resolve --applied
not working on new project,migration ... could not be found.
][https://github.com/prisma/prisma/issues/17558](https://github.com/prisma/prisma/issues/17558)8)v5.12.0
Compare Source
Today, we are excited to share the
5.12.0
stable release 🎉🌟 Help us spread the word about Prisma by starring the repo or posting on X about the release.
Highlights
Cloudflare D1 (Preview)
This release brings Preview support for Cloudflare D1 with Prisma ORM 🥳
D1 is Cloudflare’s SQLite database that can be used when deploying applications with Cloudflare.
When using Prisma ORM with D1, you can continue to: model your database with Prisma schema language, specify
sqlite
as your database provider in your Prisma schema, and interact with your database using Prisma Client.To use Prisma ORM and D1 on Cloudflare Workers or Cloudflare Pages, you need to set
sqlite
as your database provider and use the@prisma/adapter-d1
database adapter via thedriverAdapters
Preview feature, released back in version 5.4.0.Here is an example of sending a query to your D1 database using Prisma Client in your Worker:
📚 Documentation: Deploying a Cloudflare worker with D1 and Prisma ORM
✍️ Blog post: Build Applications at the Edge with Prisma ORM & Cloudflare D1 (Preview)
📣 Share your feedback: D1 Driver Adapter
🚀 Example project: Deploy a Cloudflare Worker with D1
createMany()
for SQLiteBringing support for
createMany()
in SQLite has been a long-awaited and highly requested feature ⭐createMany()
is a method on Prisma Client, released back in version 2.16.0, that lets you insert multiple records into your database at once. This can be really useful when seeding your database or inserting bulk data.Here is an example of using
createMany()
to create new users:Before this release, if you wanted to perform bulk inserts with SQLite, you would have most likely used
$queryRawUnsafe
to execute raw SQL queries. But now you don’t have to go through all that trouble 🙂With SQLite,
createMany()
works exactly the same way from an API standpoint as it does with other databases except it does not support theskipDuplicates
option. At the behavior level, SQLite will splitcreateMany()
entries into multipleINSERT
queries when the model in your schema contains fields with attributes like@default(dbgenerated())
or@default(autoincrement())
and when the fields are not consistently provided with values across the entries.📚Documentation:
createMany()
- Prisma Client API ReferenceFixes and Improvements
Prisma Client
Decimal
data type and combining queries (batching)findUnique()
error out when the field is ofBoolean
typerelationJoins
MySQL converts nested Decimal to floatfindUnique()
node-postgres
(pg) errors with misleadingP2010 PrismaClientKnownRequestError
when using@prisma/adapter-pg
with SSL (?sslmode=require
)Credits
Huge thanks to @yubrot, @skyzh, @anuraaga, @onichandame, @LucianBuzzo, @RobertCraigie, @arthurfiorette, @elithrar for helping!
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.