PackageTrack

npm ยท #3659 most downloaded on npm

@prisma/client

7.10.0prisma/prisma โ†—

Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.

Release timeline

10653 releases since 2020
20202026

One column per quarter.

Releases

  1. 4.5.0-dev.4216 Oct 2022pre-release

    Nothing published for this version

  2. 4.5.0-dev.4115 Oct 2022pre-release

    Nothing published for this version

  3. 4.5.0-dev.4014 Oct 2022pre-release

    Nothing published for this version

  4. 4.5.0-dev.3914 Oct 2022pre-release

    Nothing published for this version

  5. 4.5.0-dev.3814 Oct 2022pre-release

    Nothing published for this version

  6. 4.5.0-dev.3713 Oct 2022pre-release

    Nothing published for this version

  7. 4.5.0-dev.3613 Oct 2022pre-release

    Nothing published for this version

  8. 4.5.0-dev.3513 Oct 2022pre-release

    Nothing published for this version

  9. 4.5.0-dev.3413 Oct 2022pre-release

    Nothing published for this version

  10. 4.5.0-dev.3313 Oct 2022pre-release

    Nothing published for this version

  11. 4.5.0-dev.3213 Oct 2022pre-release

    Nothing published for this version

  12. 4.5.0-dev.3112 Oct 2022pre-release

    Nothing published for this version

  13. 4.5.0-dev.3012 Oct 2022pre-release

    Nothing published for this version

  14. 4.5.0-dev.2912 Oct 2022pre-release

    Nothing published for this version

  15. 4.5.0-dev.2812 Oct 2022pre-release

    Nothing published for this version

  16. 4.5.0-dev.2712 Oct 2022pre-release

    Nothing published for this version

  17. 4.5.0-dev.2612 Oct 2022pre-release

    Nothing published for this version

  18. 4.5.0-dev.2512 Oct 2022pre-release

    Nothing published for this version

  19. 4.5.0-dev.2412 Oct 2022pre-release

    Nothing published for this version

  20. 4.5.0-dev.2312 Oct 2022pre-release

    Nothing published for this version

  21. 4.5.0-dev.2211 Oct 2022pre-release

    Nothing published for this version

  22. 4.5.0-dev.2111 Oct 2022pre-release

    Nothing published for this version

  23. 4.5.0-dev.2011 Oct 2022pre-release

    Nothing published for this version

  24. 4.5.0-dev.1911 Oct 2022pre-release

    Nothing published for this version

  25. 4.5.0-dev.1811 Oct 2022pre-release

    Nothing published for this version

  26. 4.5.0-dev.177 Oct 2022pre-release

    Nothing published for this version

  27. 4.5.0-dev.166 Oct 2022pre-release

    Nothing published for this version

  28. 4.5.0-dev.156 Oct 2022pre-release

    Nothing published for this version

  29. 4.5.0-dev.146 Oct 2022pre-release

    Nothing published for this version

  30. 4.5.0-dev.136 Oct 2022pre-release

    Nothing published for this version

  31. 4.5.0-dev.125 Oct 2022pre-release

    Nothing published for this version

  32. 4.5.0-dev.115 Oct 2022pre-release

    Nothing published for this version

  33. 4.5.0-dev.105 Oct 2022pre-release

    Nothing published for this version

  34. 4.5.0-dev.94 Oct 2022pre-release

    Nothing published for this version

  35. 4.5.0-dev.829 Sept 2022pre-release

    Nothing published for this version

  36. 4.5.0-dev.728 Sept 2022pre-release

    Nothing published for this version

  37. 4.5.0-dev.628 Sept 2022pre-release

    Nothing published for this version

  38. 4.5.0-dev.528 Sept 2022pre-release

    Nothing published for this version

  39. 4.5.0-dev.428 Sept 2022pre-release

    Nothing published for this version

  40. 4.5.0-dev.328 Sept 2022pre-release

    Nothing published for this version

  41. 4.5.0-dev.228 Sept 2022pre-release

    Nothing published for this version

  42. 4.5.0-dev.128 Sept 2022pre-release

    Nothing published for this version

  43. 4.4.027 Sept 2022
    Release notes

    ๐ŸŒŸ Help us spread the word about Prisma by starring the repo or tweeting about the release. ๐ŸŒŸ

    Major improvements

    General improvements

    In the last sprint, we focused our efforts on squashing as many bugs as we could. You can find the full list of improvements and bug fixes in the Fixes and improvements section below.

    Some of the improvements we made include but are not limited to:

    • Improved optimistic concurrency control (GitHub issue)
    • Improved decimal precision
    • Improved handling of big amounts of prepared statement placeholders: Databases impose limits when they hit a specific number, and when a query (either generated by Prisma Client or provided by the user directly as a raw query) hits it some users ran into a misleading Can't reach database server error message (GitHub issue). The error message will now be more useful (P2035 error code), and Prisma Client should not cause these errors anymore.

    If you notice any regression, please make sure to create a GitHub issue. We touched a lot of code in this sprint, and even though we are confident in our tests, something might have slipped through the cracks. We'd like to fix the regressions as soon as possible.

    isolationLevel for sequential transaction operations

    In version 4.2.0, we added support for setting transaction isolation levels for interactive transactions (Preview). You can now define isolation levels for sequential transaction operations: prisma.$transaction([]).

    Isolation levels describe different types of trade-offs between isolation and performance that databases can make when processing transactions. Isolation levels determine what types of data leaking can occur between transactions or what data anomalies can occur. To set the transaction isolation level, use the isolationLevel option in the second parameter of the API. For example:

    await prisma.$transaction(
      [
        // sequential operations
        prisma.user.create({ data: {/** args */ } }),
        prisma.post.create({ data: {/** args  */ } })
      ],
      {
        isolationLevel: Prisma.TransactionIsolationLevel.Serializable
      }
    )
    

    Prisma Client supports the following isolation levels if they're available in your database provider:

    • ReadCommitted
    • ReadUncommitted
    • RepeatableRead
    • Serializable
    • Snapshot

    Learn more about it in our documentation.

    New P2034 error code for transaction conflicts or deadlocks

    When using certain isolation levels, it is expected that a transaction can fail due to a write conflict or a deadlock, throwing an error. One way to solve these cases is by retrying the transaction.

    To make this easier, we're introducing a new PrismaClientKnownRequestError with the error code P2034: "Transaction failed due to a write conflict or a deadlock. Please retry your transaction". You can programmatically catch the error and retry the transaction. Here's an example showing how you can retry a transaction:

    import { Prisma, PrismaClient } from '@prisma/client'
    
    const prisma = new PrismaClient()
    async function main() {
      const MAX_RETRIES = 5
      let retries = 0;
    
      let result;
      while (retries < MAX_RETRIES) {
        try {
          result = await prisma.$transaction(
            [
              prisma.user.deleteMany({ where: { /**  args */ } }),
              prisma.post.createMany({ data: { /**  args */ } })
            ],
            {
              isolationLevel: Prisma.TransactionIsolationLevel.Serializable
            }
          )
        } catch (error) {
          if (error.code === 'P2034') {
            retries++
            continue
          }
          throw error
        }
      }
    }
    

    Fixes and improvements

    Prisma Client

    Prisma

    Prisma Migrate

    Prisma Studio

    Credits

    Huge thanks to @abenhamdine, @miguelgargallo, @Clansty, @panoplied, @MEnnabah, @drzamich, @AndrewSouthpaw, @kt3k for helping!

    ๐Ÿ’ผ We're hiring!

    If you're interested in joining our growing team to help empower developers to build data-intensive applications, Prisma is the place for you.

    We're looking for a Developer Advocate (Frontend / Fullstack) and Back-end Engineer: Prisma Data Platform.

    Feel free to read the job descriptions and apply using the links provided.

    Prisma Data Platform

    We're working on the Prisma Data Platform โ€” a collaborative environment for connecting apps to databases. It includes the:

    • Data Browser for navigating, editing, and querying data
    • Data Proxy for your database's persistent, reliable, and scalable connection pooling.
    • Query Console for experimenting with queries

    Try it out and let us know what you think!

    ๐Ÿ“บ Join us for another "What's new in Prisma" livestream

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

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

    Open source โ†’
  44. 4.4.0-integration-feat-deno-deploy.112 Sept 2022pre-release

    Nothing published for this version

  45. 4.4.0-integration-engines-4-4-0-61-integration-smaller-pg-batch-size-d648eeea3754295b57706d66257a7fe7be19c7c9.326 Sept 2022pre-release

    Nothing published for this version

  46. 4.4.0-integration-engines-4-4-0-61-integration-smaller-pg-batch-size-d648eeea3754295b57706d66257a7fe7be19c7c9.226 Sept 2022pre-release

    Nothing published for this version

  47. 4.4.0-integration-engines-4-4-0-61-integration-smaller-pg-batch-size-d648eeea3754295b57706d66257a7fe7be19c7c9.126 Sept 2022pre-release

    Nothing published for this version

  48. 4.4.0-integration-engines-4-4-0-58-integration-sqlite-conversion-panic-27ab384f9b6367b324482ba93a5accaac01231ec.123 Sept 2022pre-release

    Nothing published for this version

  49. 4.4.0-integration-engines-4-4-0-56-integration-sqlite-conversion-panic-3ba0d959e76c2282691aecac535009a8c0fd2ff1.123 Sept 2022pre-release

    Nothing published for this version

  50. 4.4.0-integration-engines-4-4-0-55-qe-transaction-write-conflict-911f8bae8f9b08719066939ba0aaff82c1fe4a50.123 Sept 2022pre-release

    Nothing published for this version

  51. 4.4.0-integration-engines-4-4-0-54-integration-database-assertion-violation-error-2-4eff3e6e5529e98980308c423c302b1fcfc72e6a.323 Sept 2022pre-release

    Nothing published for this version

  52. 4.4.0-integration-engines-4-4-0-54-integration-database-assertion-violation-error-2-4eff3e6e5529e98980308c423c302b1fcfc72e6a.223 Sept 2022pre-release

    Nothing published for this version

  53. 4.4.0-integration-engines-4-4-0-54-integration-database-assertion-violation-error-2-4eff3e6e5529e98980308c423c302b1fcfc72e6a.123 Sept 2022pre-release

    Nothing published for this version

  54. 4.4.0-integration-engines-4-4-0-53-integration-database-assertion-violation-error-2-a1d9ea82ae39e90813e839586d113a19a1438f65.123 Sept 2022pre-release

    Nothing published for this version

  55. 4.4.0-integration-engines-4-4-0-50-integration-database-assertion-violation-error-2-ed23821e01366277c5fbc9b7b44e6b66f3a18fd0.123 Sept 2022pre-release

    Nothing published for this version

  56. 4.4.0-integration-engines-4-4-0-45-mongodb-url-error-038539e4f3ccddf32d7f3eaa63da07b1f3db2386.122 Sept 2022pre-release

    Nothing published for this version

  57. 4.4.0-integration-engines-4-4-0-44-integration-database-assertion-violation-error-2-78d1421518fddc0b4cf781bcb17e2f3bca3b0f24.122 Sept 2022pre-release

    Nothing published for this version

  58. 4.4.0-integration-engines-4-4-0-43-integration-query-raw-itx-mongo-e5ccee611e0dac785d27c75481672389bdf102dc.122 Sept 2022pre-release

    Nothing published for this version

  59. 4.4.0-integration-engines-4-4-0-42-integration-query-raw-itx-mongo-89509fc6084c9ae736828beef25ad86b82179273.122 Sept 2022pre-release

    Nothing published for this version

  60. 4.4.0-integration-engines-4-4-0-4-integration-deno-preview-flag-3c1168fbf77b17ded4f89a480e467eddb5302d77.131 Aug 2022pre-release

    Nothing published for this version