Skip to content
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

Update prisma monorepo to ^5.15.0 #412

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 25, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
@prisma/adapter-neon (source) ^5.12.1 -> ^5.15.0 age adoption passing confidence
@prisma/client (source) 5.12.1 -> 5.15.0 age adoption passing confidence
@prisma/internals (source) 5.12.1 -> 5.15.0 age adoption passing confidence
@prisma/migrate (source) 5.12.1 -> 5.15.0 age adoption passing confidence
prisma (source) 5.12.1 -> 5.15.0 age adoption passing confidence

Release Notes

prisma/prisma (@​prisma/adapter-neon)

v5.15.0

Compare Source

Today, we are excited to share the 5.15.0 stable release 🎉

🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟

Highlights

Multi-File Prisma Schema support

Prisma ORM 5.15.0 features support for multi-file Prisma Schema in Preview.

This closes a long standing issue and does so in a clean and easy to migrate way.

To get started:

  1. Enable the prismaSchemaFolder Preview feature by including it in the previewFeatures field of your generator.
    datasource db {
      provider = "postgresql"
      url      = env("DATABASE_URL")
    }
    
    generator client {
      provider        = "prisma-client-js"
      previewFeatures = ["prismaSchemaFolder"]
    }
    
  2. Create a schema subdirectory under your prisma directory.
  3. Move your schema.prisma into this directory.

You are now set up with a multi-file Prisma Schema! Add as many or as few .prisma files to the new prisma/schema directory.

When running commands where a Prisma Schema file is expected to be provided, you can now define a Prisma Schema directory. This includes Prisma CLI commands that use the --schema option as well as defining schema via package.json

Our tooling has also been updated to handle multiple Prisma Schema files. This includes our Visual Studio Code extension and tools like database introspection, which will deposit new models in a introspected.prisma file. Existing models will be updated in the file they are found.

To learn more, please refer to our official documentation and announcement blog post. If you try out prismaSchemaFolder, please let us know!

Interesting Bug Fixes
Fix for PostgreSQL prepared statement caching for raw queries

This release fixes a nasty bug with the caching of prepared statements in raw Prisma Client queries that affected PostgreSQL when you ran the same SQL statement with differently typed paramters. This should not fail any more.

Fix for SQL Server introspection of (deprecated) CREATE DEFAULT

Our Introspection logic crashed on encountering certain multi-line CREATE DEFAULT, a deprecated way to define defaults in SQL Server. As many SQL Server users are working with established databases, this happened frequently enough that we now explicitly ignore these defaults instead of crashing.

Fix for Cloudflare D1’s lower parameter limit

Cloudflare’s D1 has a lower parameter limit than local SQLite, which caused bigger queries to fail. We adapted that limit to the D1 default for @prisma/adapter-d1, which will avoid such failures.

Fix for Cloudflare D1’s different PRAGMA support

Our generated migration SQL for SQLite did not always work for Cloudflare D1, because of differences in the supported pragmas. We adapted the SQL to work in both local SQLite and Cloudflare D1.

Fixes and improvements
Prisma Migrate
Prisma Client
Language tools (e.g. VS Code)
Credits

Huge thanks to @​pranayat, @​yubrot, and @​skyzh for helping!

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 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.

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.

const postBodies = req.json()['posts']

const postTitles = prisma.post.createManyAndReturn({
  data: postBodies,
  select: {
    title: true,
  },
});

return postTitles

Full documentation for this feature can be found in the Prisma Client API Reference.

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.

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 include in operators or relation loading.

Fixes and improvements

Prisma Client
Prisma Migrate
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!

New product announcement: Prisma Optimize

With this release, we are excited to introduce a new Prisma product. We’re calling it “Optimize” because that’s what it does! Let your favorite ORM also help you debug the performance of your application.

Check out our announcement blog post for more details, including a demo video.

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-requested 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 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 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:

// schema.prisma
generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["omitApi"]
}

Be sure to re-generate Prisma Client afterwards:

npx prisma generate

Here is an example of using omit:

// Includes all fields except password
await prisma.user.findMany({
  omit: {
   password: true
  },
})

Here is an example of using omit with include:

// 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
      },
    },
  },
})
Expand to view the example Prisma schema
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
}

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 Reference

Fixes and improvements

Prisma Migrate
Prisma Client

Credits

Huge thanks to @​ospfranco, @​pranayat, @​yubrot, @​skyzh, @​anuraaga, @​yehonatanz, @​arthurfiorette, @​elithrar, @​tockn, @​Kuhave, @​obiwac 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.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

Copy link

vercel bot commented Apr 25, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
emily-calder-performing-arts ❌ Failed (Inspect) Jun 4, 2024 1:23pm
emily-calder-performing-arts-admin ❌ Failed (Inspect) Jun 4, 2024 1:23pm

@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from c63ca3d to b584f87 Compare May 9, 2024 10:28
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from b584f87 to a7cffba Compare May 9, 2024 11:13
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from a7cffba to 829060e Compare May 14, 2024 14:31
@renovate renovate bot changed the title Update prisma monorepo to ^5.13.0 Update prisma monorepo to ^5.14.0 May 14, 2024
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch 2 times, most recently from dbc3e2f to e7d4d84 Compare May 29, 2024 08:52
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from e7d4d84 to 8041a0a Compare June 2, 2024 06:16
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from 8041a0a to a8372ae Compare June 2, 2024 07:03
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from a8372ae to b105e37 Compare June 3, 2024 08:04
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from b105e37 to 05b74c5 Compare June 3, 2024 22:25
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.

None yet

0 participants