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.6.0-dev.3631 Oct 2022pre-release

    Nothing published for this version

  2. 4.6.0-dev.3531 Oct 2022pre-release

    Nothing published for this version

  3. 4.6.0-dev.3428 Oct 2022pre-release

    Nothing published for this version

  4. 4.6.0-dev.3328 Oct 2022pre-release

    Nothing published for this version

  5. 4.6.0-dev.3227 Oct 2022pre-release

    Nothing published for this version

  6. 4.6.0-dev.3127 Oct 2022pre-release

    Nothing published for this version

  7. 4.6.0-dev.3027 Oct 2022pre-release

    Nothing published for this version

  8. 4.6.0-dev.2927 Oct 2022pre-release

    Nothing published for this version

  9. 4.6.0-dev.2826 Oct 2022pre-release

    Nothing published for this version

  10. 4.6.0-dev.2726 Oct 2022pre-release

    Nothing published for this version

  11. 4.6.0-dev.2626 Oct 2022pre-release

    Nothing published for this version

  12. 4.6.0-dev.2526 Oct 2022pre-release

    Nothing published for this version

  13. 4.6.0-dev.2426 Oct 2022pre-release

    Nothing published for this version

  14. 4.6.0-dev.2326 Oct 2022pre-release

    Nothing published for this version

  15. 4.6.0-dev.2226 Oct 2022pre-release

    Nothing published for this version

  16. 4.6.0-dev.2126 Oct 2022pre-release

    Nothing published for this version

  17. 4.6.0-dev.2026 Oct 2022pre-release

    Nothing published for this version

  18. 4.6.0-dev.1925 Oct 2022pre-release

    Nothing published for this version

  19. 4.6.0-dev.1825 Oct 2022pre-release

    Nothing published for this version

  20. 4.6.0-dev.1725 Oct 2022pre-release

    Nothing published for this version

  21. 4.6.0-dev.1625 Oct 2022pre-release

    Nothing published for this version

  22. 4.6.0-dev.1525 Oct 2022pre-release

    Nothing published for this version

  23. 4.6.0-dev.1425 Oct 2022pre-release

    Nothing published for this version

  24. 4.6.0-dev.1324 Oct 2022pre-release

    Nothing published for this version

  25. 4.6.0-dev.1222 Oct 2022pre-release

    Nothing published for this version

  26. 4.6.0-dev.1121 Oct 2022pre-release

    Nothing published for this version

  27. 4.6.0-dev.1020 Oct 2022pre-release

    Nothing published for this version

  28. 4.6.0-dev.920 Oct 2022pre-release

    Nothing published for this version

  29. 4.6.0-dev.820 Oct 2022pre-release

    Nothing published for this version

  30. 4.6.0-dev.720 Oct 2022pre-release

    Nothing published for this version

  31. 4.6.0-dev.620 Oct 2022pre-release

    Nothing published for this version

  32. 4.6.0-dev.519 Oct 2022pre-release

    Nothing published for this version

  33. 4.6.0-dev.419 Oct 2022pre-release

    Nothing published for this version

  34. 4.6.0-dev.319 Oct 2022pre-release

    Nothing published for this version

  35. 4.6.0-dev.219 Oct 2022pre-release

    Nothing published for this version

  36. 4.6.0-dev.119 Oct 2022pre-release

    Nothing published for this version

  37. 4.5.018 Oct 2022
    Release notes

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

    Major improvements

    Filter for non-unique properties in unique where queries (Preview)

    In this release, we are adding support for non-unique properties inside the where statement for queries that operate on a unique record (e.g.: findUnique, update, delete, etc.). This was not possible in the past, as we only allowed unique fields as filters inside the where statement for the queries in question.

    There are use cases where a query that operates on a unique record requires further filtering by non-unique properties. For example, for the following model:

    model Article {
      id      Int    @id @default(autoincrement())
      content String
      version Int
    }
    

    Let’s say that you would like to update the Article with an id of “5”, but only if the version equals "1":

    await prisma.article.update({
        where: { id: 5, version: 1 }, // `version` field was not available before Prisma 4.5.0
        data: {
            content: "Incredible new story",
            version: { increment: 1 },
        },
    });
    
    

    With 4.5.0, we are adding support to specify any number of non-unique fields in your where statement, as long as you have at least one unique field.

    To use it, enable the Preview feature flag:

    generator js {
      provider        = "prisma-client-js"
      previewFeatures = ["extendedWhereUnique"]
    }
    

    To learn more about this feature and about use cases where it can be useful, please check out our documentation. For feedback, please leave a comment on the GitHub issue.

    PostgreSQL extension management (Preview)

    We are excited to add support for declaring PostgreSQL extensions in the Prisma schema. The feature comes with support for introspection and migrations. This will allow you to adopt, evolve and manage which PostgreSQL database extensions are installed directly from within your Prisma schema.

    💡 This feature adds support to manage PostgreSQL extensions in Prisma schema. It does not provide additional query capabilities and datatypes in Prisma Client.

    To try this feature, enable the Preview feature flag:

    generator client {
      provider        = "prisma-client-js"
      previewFeatures = ["postgresqlExtensions"]
    }
    
    datasource db {
      provider = "postgresql"
      url      = env("DATABASE_URL")
    }
    

    Now you will be able to use the new extensions property in the datasource block of your Prisma schema.

    datasource db {
      provider   = "postgresql"
      url        = env("DATABASE_URL")
      extensions = [hstore(schema: "myHstoreSchema"), pg_tgrm, postgis(version: "2.1")]
    }
    

    ⚠️ To avoid noise from introspection, we currently only introspect the following allow-list: citext, pgcrypto, uuid-ossp, and postgis. But you can add and configure any extension to your Prisma schema manually.

    Please visit our documentation to learn more about this feature or leave a comment with feedback on the GitHub issue.

    Change to Referential Integrity — property in datasource block renamed to relationMode (Preview)

    To prepare Prisma Client’s emulation of relations for general availability, we are releasing several improvements to the referentialIntegrity Preview feature.

    We decided to rename the feature to Relation Mode. We think this closer reflects what this feature does and distinguishes it from integrity management on the database level. The related property in the datasource block of the Prisma schema has also been changed from referentialIntegrity to relationMode.

    ⚠️ The Preview feature flag inside the generator block of the Prisma schema is still called referentialIntegrity.

    To use it, keep using the old referentialIntegrity Preview feature flag:

    generator js {
      provider        = "prisma-client-js"
      previewFeatures = ["referentialIntegrity"]
    }
    

    But use the new property name in the datasource:

    datasource db {
      provider     = "mysql"
      url          = env("DATABASE_URL")
      relationMode = "prisma"
    }
    

    We also removed the referential action NoAction for PostgreSQL and SQLite when using relationMode = "prisma" as we are not planning to support the details of the database behavior.

    To learn more about relationMode, please check out the documentation or leave a comment on the GitHub issue.

    Deno for Prisma Client for Data Proxy (Preview)

    Deno is an alternative JavaScript runtime that can replace Node.js to run JS and TS apps. It aligns itself closely with web technologies, claims to be secure by default, and supports TypeScript out of the box.

    Today we are releasing initial support for Prisma with Deno via an integration for our Prisma Client for Data Proxy. This feature was developed together with the amazing team at Deno 🦕.

    To use Prisma Client in a Deno project, add the deno Preview feature flag to your Prisma schema and define a folder as output (this is required for Deno):

    generator client {
      provider        = "prisma-client-js"
      previewFeatures = ["deno"]
      output          = "../generated/client"
    }
    

    Now you can generate Prisma Client with the Data Proxy using the command npx prisma generate --data-proxy. Then use Prisma Client in your Deno script with the following import:

    import { PrismaClient } from './generated/client/deno/edge.ts'
    
    const prisma = new PrismaClient()
    
    async function main() {
        const users = await prisma.user.findMany()
        console.log({ users })
    }
    
    main()
    

    You can also deploy an app built and configured like this on Deno Deploy, Deno’s deployment platform. Read this guide in our documentation for a full example and individual steps.

    For feedback, please comment on this GitHub issue.

    Fixed “Invalid string length” error in Prisma Studio and Prisma Data Platform Data Browser

    Many people were having issues with an "Invalid string length" error both in Prisma Studio and Prisma Data Platform Data Browser. This issue can be resolved through this workaround. With this release, the root cause of this issue has been fixed and it should not occur again.

    Updated proposal for Client Extensions: request for comments

    In 4.3.0, we shared a proposal for Prisma Client Extensions on Github. We received a lot of great feedback, which we have incorporated into a new proposal.

    If you’re interested, please head over to the new proposal in GitHub and tell us what you think. Thank you!

    Fixes and improvements

    Prisma

    Prisma Client

    Prisma Migrate

    Language tools (e.g. VS Code)

    Credits

    Huge thanks to @kt3k, @abenhamdine, @jsoref for helping!

    Open source →
  38. 4.5.0-integration-use-keep-alive-for-node-fetch.114 Oct 2022pre-release

    Nothing published for this version

  39. 4.5.0-integration-fix-inline-schema.318 Oct 2022pre-release

    Nothing published for this version

  40. 4.5.0-integration-fix-inline-schema.218 Oct 2022pre-release

    Nothing published for this version

  41. 4.5.0-integration-fix-inline-schema.118 Oct 2022pre-release

    Nothing published for this version

  42. 4.5.0-integration-feat-deno-deploy.517 Oct 2022pre-release

    Nothing published for this version

  43. 4.5.0-integration-feat-deno-deploy.415 Oct 2022pre-release

    Nothing published for this version

  44. 4.5.0-integration-feat-deno-deploy.315 Oct 2022pre-release

    Nothing published for this version

  45. 4.5.0-integration-feat-deno-deploy.214 Oct 2022pre-release

    Nothing published for this version

  46. 4.5.0-integration-feat-deno-deploy.111 Oct 2022pre-release

    Nothing published for this version

  47. 4.5.0-integration-engines-4-5-0-6-integration-referential-integrity-to-relation-mode-ce007889ace730267c3faed050f4b34840679042.129 Sept 2022pre-release

    Nothing published for this version

  48. 4.5.0-integration-engines-4-5-0-5-integration-referential-integrity-to-relation-mode-03c061955daafa43d6cd07f0fc968ea3c723773c.129 Sept 2022pre-release

    Nothing published for this version

  49. 4.5.0-integration-engines-4-5-0-44-integration-fix-15655-cd15cc453ecedba322f3bb6dff831b949e0dd170.118 Oct 2022pre-release

    Nothing published for this version

  50. 4.5.0-integration-engines-4-5-0-4-integration-referential-integrity-to-relation-mode-036fe8cea132c9f376eb7648e202485b6a5287dc.129 Sept 2022pre-release

    Nothing published for this version

  51. 4.5.0-integration-engines-4-5-0-28-integration-fix-15655-a3da7a3ae1839ca228b66e69fab957408a6a866a.112 Oct 2022pre-release

    Nothing published for this version

  52. 4.5.0-integration-engines-4-5-0-21-integration-remove-simulated-noaction-for-postgres-and-sqlite-2e08a7244ca876351adc7689a8c3551c315eac5c.111 Oct 2022pre-release

    Nothing published for this version

  53. 4.5.0-dev.5018 Oct 2022pre-release

    Nothing published for this version

  54. 4.5.0-dev.4918 Oct 2022pre-release

    Nothing published for this version

  55. 4.5.0-dev.4818 Oct 2022pre-release

    Nothing published for this version

  56. 4.5.0-dev.4717 Oct 2022pre-release

    Nothing published for this version

  57. 4.5.0-dev.4617 Oct 2022pre-release

    Nothing published for this version

  58. 4.5.0-dev.4517 Oct 2022pre-release

    Nothing published for this version

  59. 4.5.0-dev.4417 Oct 2022pre-release

    Nothing published for this version

  60. 4.5.0-dev.4317 Oct 2022pre-release

    Nothing published for this version