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

fix(deps): update dependency @prisma/client to v4.16.2 #82

Merged
merged 1 commit into from
Aug 7, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jul 22, 2023

Mend Renovate

This PR contains the following updates:

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

Release Notes

prisma/prisma (@​prisma/client)

v4.16.2

Compare Source

Today, we are issuing the 4.16.2 patch release.

Fixes in Prisma Client

v4.16.1

Compare Source

Today, we are issuing the 4.16.1 patch release.

Fixes in Prisma Client

v4.16.0

Compare Source

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

Highlights

This release promotes the following Preview features to General Availability:

  • Prisma Client extensions
  • Ordering by nulls first and last
  • Count by filtered relation
Prisma Client extensions are Generally Available

Today, we’re very excited to announce that Prisma Client extensions are Generally Available and production-ready! This means you can use the feature without the clientExtensions Preview feature flag.🚀

Prisma Client extensions are a powerful new feature for adding functionality on top of your Prisma Client in a type-safe manner. With this feature, you can create simple, but flexible solutions.

Prisma Client extensions have 4 different types of components that can be included in an extension:

  • Result extensions components: add custom fields and methods to query result objects, for example, virtual/computed fields.
  • Model extensions components: enable you to add new methods to your models alongside existing model methods such as findMany.
  • Query extensions components: let you hook into the lifecycle of a query and perform side effects, modify query arguments, or modify the results in a type-safe way. These are an alternative to middleware that provide complete type safety and can be applied in an ad-hoc manner to different extensions.
  • Client extensions components: allow you to add new top-level methods to Prisma Client. You can use this to extend Prisma Client with functionality that isn’t tied to specific models.
const prisma = new PrismaClient().$extends({
  name: "extension-name",
  result: { /* ... */ },
  model: { /* ... */ },
  query: { /* ... */ },
  client: { /* ... */ },
});

You can also create and publish extensions for others to use. Learn more about how to share extensions in our documentation.

More features and changes made to Client Extensions

We also made the following improvements to Prisma Client extensions in preparation for General Availability:

  • Added a top-level $allOperations method for query component that captures all model operations as well as top-level raw queries. Refer to our documentation for more information.

    const prisma = new PrismaClient().$extends({
      query: {
        $allOperations({ args, query, operation, model }) {
          /* your extension's logic here */
        }
      }
    })
  • Prisma.validator can now also be used for extended types:

    const prisma = new PrismaClient().$extends({/* ... */})
    const data = Prisma.validator(prisma, 'user', 'findFirst', 'select')({
      id: true,
    })
  • query callbacks for $queryRaw and $executeRaw will always receive Sql instance as args. This instance can be used to compose a new query using Prisma.sql:

    const prisma = new PrismaClient().$extends({
      query: {
        $queryRaw({ args, query }) {
          return query(Prisma.sql`START TRANSACTION; ${args}; COMMIT;`)
        }
      }
    })
  • $on cannot be called after extending Prisma Client. Therefore, if you want to use event handlers together with extensions, we recommend using the $on method before $extends.

    const prisma = new PrismaClient()
      .$on(/* ... */)
      .$extends({/* ... */})
  • We updated the import path for utilities used for authoring extension to @prisma/client/extension rather than @prisma/client

    + import { Prisma } from "@​prisma/client/extension"
    - import { Prisma } from "@​prisma/client"
Deprecating Middleware

We also took this opportunity to deprecate Prisma Client’s middleware. We recommend using to using Prisma Client query extension components which can be used to achieve the same functionality and with better type safety.

🚧 Middleware will still be available in Prisma Client’s API. However, we recommend using Prisma Client extensions over middleware.

Ordering by nulls first and last is now Generally Available

Starting with this release, we’re excited to announce that orderByNulls is now Generally Available! This means you can use the feature without the orderByNulls Preview feature flag.🌟

We introduced this feature in 4.1.0 to enable you to sort records with null fields to either appear at the beginning or end of the result.

The following example query sorts posts by updatedAt, with records having a null value at the end of the list:

await prisma.post.findMany({
  orderBy: {
    updatedAt: { sort: 'asc', nulls: 'last' },
  },
})

To learn more about this feature, refer to our documentation.

We’re excited to see what you will build! Feel free to share with us what you build on Twitter, Slack, or Discord.

Count by filtered relation is now Generally Available

This release moves the filteredRelationCount Preview feature to General Availability! This means you can use the feature without the filteredRelationCount Preview feature flag.

We first introduced this feature in 4.3.0 to add the ability to count by filtered relations.

The following query, for example, counts all posts with the title “Hello!”:

await prisma.user.findMany({
  select: {
    _count: {
      select: {
        posts: { where: { title: 'Hello!' } },
      },
    },
  },
})

To learn more about this feature, refer to our documentation.

Introspection warnings for expression indexes

In the last two releases, 4.13.0 and 4.14.0, we added 9 introspection warnings. These warnings surface features in use in your database that cannot currently be represented in the Prisma schema.

In this release, we’re adding one more introspection warning to the list: expression indexes.

On database introspection, the Prisma CLI will surface the feature with a warning, and a comment in your Prisma schema for sections for each feature in use. The warnings will also contain instructions for workarounds on how to use the feature.

Fixes and improvements

Prisma Client
Prisma Migrate
Language tools (e.g. VS Code)
Prisma Studio

📺 Join us for another "What's new in Prisma" live stream

Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" live stream.

The stream takes place on YouTube on Thursday, June 22 at 5 pm Berlin | 8 am San Francisco.

v4.15.0

Compare Source

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

Highlights

For this release, we focused on fixing bugs and making smaller quality-of-life improvements.

Support for custom arguments for prisma db seed

This release adds support for defining and passing arbitrary arguments to prisma db seed. This creates the opportunity for you to define your own arguments in your seed file that you could pass to the prisma db seed command. A few example use-cases include, but are not limited to:

  • Seeding different data in different environments
  • Partially seeding data in some tables

Here is an example seed.ts file that defines custom arguments for seeding different data in different environments:

// prisma/seed.ts
import { parseArgs } from "node:util";

const options = {
  environment: { type: 'string', },
}

async function main() {
  const { values: { environment } } = parseArgs({ options })
  
  switch (environment) {
    case "development":
      /** do something for development */
      break;
    case "test":
      /** do something  for test  environment */
      break;
    default:
      break;
  }
}

main()

You can then provide the environment argument when executing the seed script as follows:

npx prisma db seed -- --environment development

Let us know what you think, share example usage of this feature, and create a bug report if you run into any issues.

Improved error messages when Query Engine file is not found

This release improves the error messages returned by Prisma Client when the Query Engine file is not found. A few reasons the Query Engine file might be missing from your application bundle include when:

  • The downloaded Query Engine doesn’t match the runtime/ target platform your application is running on.
  • The Query Engine is not copied to your final application bundle during the build step.

We hope these error messages are helpful while debugging your application.

Prisma VS Code extension improvements

In this release, we made a few improvements to our VS Code extension:

  1. Updated the file system watcher that is responsible for restarting the TypeScript server when prisma generate is run to ensure the types are in sync

    Note:

    • This new approach is currently only available on Windows and Linux. We plan on adding support for the new file system watcher on macOS soon.
    • This requires both Prisma CLI & VS code extension version 4.15.0 or higher
  2. Added Quick Fixes action for unique identifiers for MongoDB to add the @map("_id") attribute function when it’s missing on an identifier field

    Screen.Recording.2023-05-17.at.19.22.20.mov
  3. Support for renaming symbols for composite types and views

    type-symbol-rename.mov

Fixes and improvements

Prisma Client
Prisma Migrate
Language tools (e.g. VS Code)

Credits

Huge thanks to @​RobertCraigie, @​KhooHaoYit, @​art049, @​luxaritas, @​mrazauskas, @​maxmartynov, @​haneenmahd for helping!

📺 Join us for another "What's new in Prisma" live stream

Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" live stream.

The stream takes place on YouTube on Thursday, June 1 at 5 pm Berlin | 8 am San Francisco.

v4.14.1

Compare Source

Today, we are issuing the 4.14.1 patch release.

Fix in Prisma Client

v4.14.0

Compare Source

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

Request for feedback for Preview features

We would appreciate your feedback on a handful of Preview features to help us move them to General Availability soon. The Preview features include:

You can test them by enabling the Preview feature in your Prisma schema and giving them a try already in your Prisma schema, e.g., PostgreSQL extensions, or regenerating Prisma Client and trying them in your queries.

Highlights

Improved Prisma Client startup performance

For the last couple of months, we've been working hard to improve the performance of Prisma Client. We also published a blog post on how How We Sped Up Serverless Cold Starts with Prisma by 9x, which we recommend you give it a read.

This release continues with the same theme by making the size of the generated Prisma Client smaller. We have roughly halved the size of Prisma Client's dependencies.

More Introspection warnings for unsupported features

In 4.13.0, we introduced the first 6 introspection warnings that surface the existence of these features in your database and link to our documentation on how to manually work around the Prisma Schema with unsupported database features.

In this release, we added 3 more introspection warnings for the following features:

On introspecting a database using any of these features, you will get a warning from the Prisma CLI and a comment in your Prisma schema where the feature is being used. The warning will also contain a link to instructions on how to manually use the feature.

Fixes and improvements

Prisma Client
Prisma Migrate
Language tools (e.g. VS Code)

Credits

Huge thanks to @​RobertCraigie, @​KhooHaoYit, @​art049, @​luxaritas, @​mrazauskas for helping!

📺 Join us for another "What's new in Prisma" live stream

Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" live stream.

The stream takes place on YouTube on Thursday, May 11 at 5 pm Berlin | 8 am San Francisco.

v4.13.0

Compare Source

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

Highlights
Introspection warnings for unsupported features

The Prisma Schema Language (PSL) currently doesn't support all database features and functionality of our target databases. The PSL is an abstraction over SQL and will keep evolving to address gaps in our database feature matrix.

Before this release, prisma db pull did not pick up the unsupported features in a database. It was easy to lose them when running prisma migrate dev based on an existing Prisma schema if not included in a migration file using custom migrations.

To avoid this, we added introspection warnings that surface the existence of these features in your database and link to our documentation on how to manually work around the Prisma Schema with unsupported database features.

In this release, we added introspection warnings for the following features:

Prisma CLI will output warnings on introspection (prisma db pull) and add comments to your Prisma schema. In the coming releases, we will expand this to many more features labeled with topic: database-functionality on GitHub.

Improved support for Netlify and Vercel build process

Netlify and Vercel cache project dependencies during the build process and reuse that cache until dependencies change. While this helps speed up the build process, any postinstall scripts of these dependencies will not be executed.

Prisma uses a postinstall script in its package to automatically trigger the customized generation of Prisma Client for your Prisma Schema. When a dependency cache is used, that generation process is not triggered, and an outdated Prisma Client may be used in your application.

When you update your Prisma Schema but not your dependencies, Prisma Client will not be generated for the new schema. For example, columns you added recently to one of your models will not be present in the Prisma Client API - causing errors.

This problem can be avoided by:

  1. Adding a custom postinstall script in your package.json file
  2. Manually adding a prisma generate step to the “Build” scripts of Vercel and Netlify.

We now added detection of this scenario and will prevent a build without an additional prisma generate. This will ensure you're aware of the problem early and get guidance on how to fix this problem. You can read more on how to do this in our docs — Vercel caching troubleshooting, Netlify caching troubleshooting.

Better support for pnpm as a package manager

Before this release, Prisma only used npm scripts which would lead to undesirable behavior for a project using a different package manager such as pnpm and yarn. This release improves the detection of the package managers in your project by using ni. If you're still running into this problem, let us know by creating a GitHub issue.

Segmentation fault and TLS connection error fix

In this release, we've fixed a TLS connection error segmentation fault. This mostly affected users running on Node.js 17 or later with OpenSSL 1.1 when using TLS to connect to their database.

JSON protocol Preview feature feedback

We have fixed multiple bugs for the jsonProtocol Preview feature and are close to making it Generally Available. We are still looking for feedback about its usage to ensure it is ready and works as expected for everyone.

We would appreciate it if you would try it out, help us polish the feature, and move it to General Availability. Testing it requires little effort. You can test it using the following steps:

  1. Enabling the jsonProtocol Preview feature in your Prisma schema
  2. Re-generating Prisma Client
  3. Running your application or tests to make sure everything works

We encourage you to leave your feedback in this GitHub issue or create a bug report if your run into any issues.

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

Huge thanks to @​KhooHaoYit, @​rintaun, @​maxmartynov, @​haneenmahd for helping!

📺 Join us for another "What's new in Prisma" live stream

Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" live stream.

The stream takes place on YouTube on Thursday, April 20 at 5 pm Berlin | 8 am San Francisco.


Configuration

📅 Schedule: Branch creation - "after 4pm on friday,before 9am on monday,every weekend" in timezone Europe/Paris, 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 this update 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.

@renovate renovate bot force-pushed the renovate/prisma-monorepo branch 2 times, most recently from 0b16d1f to 3325d34 Compare August 4, 2023 14:22
@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov upload limit reached ⚠️

This org is currently on the free Basic Plan; which includes 250 free private repo uploads each rolling month. This limit has been reached and additional reports cannot be generated. For unlimited uploads, upgrade to our pro plan.

Do you have questions or need help? Connect with our sales team today at sales@codecov.io

@renovate renovate bot force-pushed the renovate/prisma-monorepo branch 5 times, most recently from 12ba809 to 054eb77 Compare August 5, 2023 04:15
@renovate renovate bot changed the title Update dependency @prisma/client to v4.16.2 fix(deps): update dependency @prisma/client to v4.16.2 Aug 5, 2023
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch 6 times, most recently from b3cba39 to 8aaeb03 Compare August 6, 2023 04:17
@renovate renovate bot changed the title fix(deps): update dependency @prisma/client to v4.16.2 Update dependency @prisma/client to v4.16.2 Aug 6, 2023
Base automatically changed from chore/renovateBaseBranch to main August 7, 2023 11:45
@renovate
Copy link
Contributor Author

renovate bot commented Aug 7, 2023

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

Warning: custom changes will be lost.

@bodinsamuel bodinsamuel changed the base branch from main to chore/renovateBaseBranch August 7, 2023 14:21
@renovate renovate bot changed the title Update dependency @prisma/client to v4.16.2 fix(deps): update dependency @prisma/client to v4.16.2 Aug 7, 2023
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from 8aaeb03 to 2b937f3 Compare August 7, 2023 14:23
@renovate renovate bot force-pushed the renovate/prisma-monorepo branch from 2b937f3 to ba15702 Compare August 7, 2023 15:36
@bodinsamuel bodinsamuel merged commit f55ea74 into chore/renovateBaseBranch Aug 7, 2023
1 check passed
@bodinsamuel bodinsamuel deleted the renovate/prisma-monorepo branch August 7, 2023 15:54
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

1 participant