nowo / vite-vue-app

0 stars 0 forks source link

fix(deps): update prisma monorepo to v5.12.1 #10

Closed renovate[bot] closed 4 months ago

renovate[bot] commented 4 months ago

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@prisma/client (source) 5.11.0 -> 5.12.1 age adoption passing confidence
prisma (source) 5.11.0 -> 5.12.1 age adoption passing confidence

Release Notes

prisma/prisma (@​prisma/client) ### [`v5.12.1`](https://togithub.com/prisma/prisma/releases/tag/5.12.1) [Compare Source](https://togithub.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). ##### Fixes in Prisma CLI ##### Windows-only fix for new D1 specific flags for `migrate diff` and `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) ##### New option for `migrate diff`: `-o` or `--output` 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) #​23702](https://togithub.com/prisma/prisma/issues/23702) - `[prisma migrate resolve --applied` not working on new project, `migration ... could not be found.`]\[https://github.com/prisma/prisma/issues/17558](https://togithub.com/prisma/prisma/issues/17558)8) ### [`v5.12.0`](https://togithub.com/prisma/prisma/releases/tag/5.12.0) [Compare Source](https://togithub.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.** #### Highlights ##### Cloudflare D1 (Preview) 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://togithub.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 { // 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://togithub.com/prisma/prisma/discussions/23646) 🚀 **Example project:** [Deploy a Cloudflare Worker with D1](https://togithub.com/prisma/prisma-examples/tree/latest/deployment-platforms/edge/cloudflare-workers/with-d1) ##### `createMany()` for SQLite Bringing support for `createMany()` in SQLite has been a [long-awaited and highly requested feature](https://togithub.com/prisma/prisma/issues/10710) ⭐ `createMany()` is a method on Prisma Client, released back in version [2.16.0](https://togithub.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) #### Fixes and Improvements ##### Prisma Client - [N+1 Issue with `Decimal` data type and combining queries (batching)](https://togithub.com/prisma/prisma/issues/5952) - [Batched `findUnique()` error out when the field is of `Boolean` type](https://togithub.com/prisma/prisma/issues/22384) - [`relationJoins` MySQL converts nested Decimal to float](https://togithub.com/prisma/prisma/issues/23233) - [Unexpected query leading to querying full table when using batched `findUnique()`](https://togithub.com/prisma/prisma/issues/23343) - [`node-postgres` (pg) errors with misleading `P2010 PrismaClientKnownRequestError` when using `@prisma/adapter-pg` with SSL (`?sslmode=require`)](https://togithub.com/prisma/prisma/issues/23390) - [D1 DateTime type does not work](https://togithub.com/prisma/prisma/issues/23479) #### Credits Huge thanks to [@​yubrot](https://togithub.com/yubrot), [@​skyzh](https://togithub.com/skyzh), [@​anuraaga](https://togithub.com/anuraaga), [@​onichandame](https://togithub.com/onichandame), [@​LucianBuzzo](https://togithub.com/LucianBuzzo), [@​RobertCraigie](https://togithub.com/RobertCraigie), [@​arthurfiorette](https://togithub.com/arthurfiorette), [@​elithrar](https://togithub.com/elithrar) for helping!

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

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.