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.8.0-dev.4213 Dec 2022pre-release

    Nothing published for this version

  2. 4.8.0-dev.4112 Dec 2022pre-release

    Nothing published for this version

  3. 4.8.0-dev.4012 Dec 2022pre-release

    Nothing published for this version

  4. 4.8.0-dev.3912 Dec 2022pre-release

    Nothing published for this version

  5. 4.8.0-dev.3812 Dec 2022pre-release

    Nothing published for this version

  6. 4.8.0-dev.379 Dec 2022pre-release

    Nothing published for this version

  7. 4.8.0-dev.368 Dec 2022pre-release

    Nothing published for this version

  8. 4.8.0-dev.358 Dec 2022pre-release

    Nothing published for this version

  9. 4.8.0-dev.348 Dec 2022pre-release

    Nothing published for this version

  10. 4.8.0-dev.338 Dec 2022pre-release

    Nothing published for this version

  11. 4.8.0-dev.328 Dec 2022pre-release

    Nothing published for this version

  12. 4.8.0-dev.318 Dec 2022pre-release

    Nothing published for this version

  13. 4.8.0-dev.308 Dec 2022pre-release

    Nothing published for this version

  14. 4.8.0-dev.297 Dec 2022pre-release

    Nothing published for this version

  15. 4.8.0-dev.287 Dec 2022pre-release

    Nothing published for this version

  16. 4.8.0-dev.277 Dec 2022pre-release

    Nothing published for this version

  17. 4.8.0-dev.267 Dec 2022pre-release

    Nothing published for this version

  18. 4.8.0-dev.257 Dec 2022pre-release

    Nothing published for this version

  19. 4.8.0-dev.246 Dec 2022pre-release

    Nothing published for this version

  20. 4.8.0-dev.236 Dec 2022pre-release

    Nothing published for this version

  21. 4.8.0-dev.225 Dec 2022pre-release

    Nothing published for this version

  22. 4.8.0-dev.215 Dec 2022pre-release

    Nothing published for this version

  23. 4.8.0-dev.202 Dec 2022pre-release

    Nothing published for this version

  24. 4.8.0-dev.192 Dec 2022pre-release

    Nothing published for this version

  25. 4.8.0-dev.182 Dec 2022pre-release

    Nothing published for this version

  26. 4.8.0-dev.172 Dec 2022pre-release

    Nothing published for this version

  27. 4.8.0-dev.162 Dec 2022pre-release

    Nothing published for this version

  28. 4.8.0-dev.152 Dec 2022pre-release

    Nothing published for this version

  29. 4.8.0-dev.142 Dec 2022pre-release

    Nothing published for this version

  30. 4.8.0-dev.131 Dec 2022pre-release

    Nothing published for this version

  31. 4.8.0-dev.121 Dec 2022pre-release

    Nothing published for this version

  32. 4.8.0-dev.111 Dec 2022pre-release

    Nothing published for this version

  33. 4.8.0-dev.101 Dec 2022pre-release

    Nothing published for this version

  34. 4.8.0-dev.91 Dec 2022pre-release

    Nothing published for this version

  35. 4.8.0-dev.81 Dec 2022pre-release

    Nothing published for this version

  36. 4.8.0-dev.71 Dec 2022pre-release

    Nothing published for this version

  37. 4.8.0-dev.630 Nov 2022pre-release

    Nothing published for this version

  38. 4.8.0-dev.530 Nov 2022pre-release

    Nothing published for this version

  39. 4.8.0-dev.430 Nov 2022pre-release

    Nothing published for this version

  40. 4.8.0-dev.330 Nov 2022pre-release

    Nothing published for this version

  41. 4.8.0-dev.230 Nov 2022pre-release

    Nothing published for this version

  42. 4.8.0-dev.129 Nov 2022pre-release

    Nothing published for this version

  43. 4.7.12 Dec 2022
    Release notesOpen source →
  44. 4.7.1-dev.32 Dec 2022pre-release

    Nothing published for this version

  45. 4.7.1-dev.21 Dec 2022pre-release

    Nothing published for this version

  46. 4.7.1-dev.11 Dec 2022pre-release

    Nothing published for this version

  47. 4.7.029 Nov 2022
    Release notes

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

    Highlights

    Interactive transactions are now Generally Available

    After an extensive Preview phase and lots of great feedback from our community, we're excited to announce that interactiveTransactions is now Generally Available and production ready! 🚀

    Interactive transactions allow you to pass an async function into a $transaction, and execute any code you like between the individual Prisma Client queries. Once the application reaches the end of the function, the transaction is committed to the database. If your application encounters an error as the transaction is being executed, the function will throw an exception and automatically rollback the transaction.

    Here are some of the feature highlights we've built:

    Here's an example of an interactive transaction with a Serializable isolation level:

    await prisma.$transaction(
      async (prisma) => {
        // Your transaction...
      },
      {
        isolationLevel: Prisma.TransactionIsolationLevel.Serializable,
        maxWait: 5000,
        timeout: 10000,
      }
    )
    

    You can now remove the interactiveTransactions Preview feature in your schema.

    Relation mode is Generally Available

    This release marks relationMode="prisma" as stable for our users working with databases that don't rely on foreign keys to manage relations. 🎉

    Prisma’s relation mode started as a way to support PlanetScale which does not allow you to create foreign keys for better online migration support. We transformed that into our Referential Integrity Emulation in 3.1.1 when we realised that more users could benefit from it, and then integrated it as the default mode for MongoDB, which generally does not have foreign keys. Prisma needed to use emulation to give the same guarantees.

    We then realized the feature was more than just referential integrity and affected how relations work. To reflect this, we renamed the feature to relation mode and the datasource property to relationMode in 4.5.0

    Index warnings for relationMode = "prisma"

    In this release, we've added a warning to our Prisma schema validation that informs you that the lack of foreign keys might result in slower performance — and that you should add an @@index manually to your schema to counter that. This ensures your queries are equally fast in relation mode prisma as they are with foreign keys.

    With relationMode = "prisma", no foreign keys are used, so relation fields will not benefit from the index usually created by the relational database under the hood. This can lead to slower performance when querying these fields. We recommend manually adding an index.

    We also added a fix to our VS Code extension to help adding the suggested index with minimal effort:

    If you are currently using the Preview feature flag to enable relation mode, you can now remove referentialIntegrity from the previewFeatures in your generator client block in your Prisma schema.

    For more information, check out our updated relation mode documentation.

    Prisma Client Extensions (Preview)

    This release adds Preview support for Prisma Client Extensions. This feature introduces new capabilities to customize and extend Prisma Client. Today we are opening up four areas for extending Prisma Client:

    Prisma Client Extensions are self-contained scripts that can tweak the behavior of models, queries, results, and the client (Prisma Client) as a whole. You can associate a single or multiple extensions with an extended client to mix and match Prisma to your needs.

    Prisma Client Extensions enables many use cases such as defining virtual fields, custom validation, and custom queries.

    It also enables you to share your client extensions with others and import client extensions developed by others into your project.

    For example, given the following schema:

    datasource db {
      provider = "postgresql"
      url      = env("DATABASE_URL")
    }
    
    generator client {
      provider        = "prisma-client-js"
      previewFeatures = ["clientExtensions"]
    }
    
    model User {
      id        Int     @id @default(autoincrement())
      email     String  @unique
      firstName String?
      lastName  String
    }
    

    You can create a computed field called fullName as follows:

    import { PrismaClient } from "@prisma/client"
    
    const prisma = new PrismaClient()
      .$extends({
        result: {
          user: {
            fullName: {
              // the dependencies
              needs: { firstName: true, lastName: true },
              compute(user) {
                // the computation logic
                return `${user.firstName} ${user.lastName}`
              },
            },
          },
        },
      })
    

    We're excited to see what you build with them! For more information, check out our docs and let us know what you think in this GitHub issue.

    Multi-schema support for PostgreSQL (Preview)

    We're pleased to announce that this release adds support for multi-schema support for PostgreSQL. The ability to query and manage multiple database schemas has been a long-standing feature request from our community.

    This release adds support for the following:

    • Introspecting databases that organize objects in multiple database schemas
    • Managing multi-schema database setups directly from Prisma schema
    • Generating migrations that are database schema-aware with Prisma Migrate
    • Querying across multiple database schemas with Prisma Client

    If you already have a PostgreSQL database using multiple schemas, you can quickly get up and running using prisma db pull — on enabling the Preview feature and specifying the schemas in the datasource block similar to the example below.

    You can get started with defining multiple schemas in your Prisma schema as follows:

    generator client {
      provider        = "prisma-client-js"
      previewFeatures = ["multiSchema"]
    }
    
    datasource db {
      provider = "postgresql"
      url      = env("DATABASE_URL")
      schemas  = ["base", "transactional"]
    }
    
    model User {
      id     Int     @id
      orders Order[]
    
      @@schema("base")
    }
    
    model Order {
      id      Int  @id
      user    User @relation(fields: [id], references: [id])
      user_id Int
    
      @@schema("transactional")
    }
    

    Then generate and apply the changes to your database with prisma migrate dev.

    We want to thank all our users for helping us design the feature since the early proposal on GitHub up to our current Preview release.

    For further details, refer to our documentation and let us know what you think in this GitHub issue.

    Request for feedback

    Our Product team is currently running a survey for designing Database Views support for Prisma and we would appreciate your feedback.

    Fixes and improvements

    Prisma Client

    Prisma

    Prisma Migrate

    Language tools (e.g. VS Code)

    Prisma Engines

    Credits

    Huge thanks to @cmd-johnson, @jsoref, @miguelgargallo for helping!

    Prisma Data Platform

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

    • 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. Let us know what you think!

    📺 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, December 1 at 5 pm Berlin | 8 am San Francisco.

    Open source →
  48. 4.7.0-integration-support-lint-warnings.115 Nov 2022pre-release

    Nothing published for this version

  49. 4.7.0-integration-itx-remove-preview-feature.724 Nov 2022pre-release

    Nothing published for this version

  50. 4.7.0-integration-itx-remove-preview-feature.621 Nov 2022pre-release

    Nothing published for this version

  51. 4.7.0-integration-itx-remove-preview-feature.518 Nov 2022pre-release

    Nothing published for this version

  52. 4.7.0-integration-itx-remove-preview-feature.418 Nov 2022pre-release

    Nothing published for this version

  53. 4.7.0-integration-itx-remove-preview-feature.315 Nov 2022pre-release

    Nothing published for this version

  54. 4.7.0-integration-itx-remove-preview-feature.215 Nov 2022pre-release

    Nothing published for this version

  55. 4.7.0-integration-itx-remove-preview-feature.114 Nov 2022pre-release

    Nothing published for this version

  56. 4.7.0-integration-itx-pdp-remove-header.418 Nov 2022pre-release

    Nothing published for this version

  57. 4.7.0-integration-itx-pdp-remove-header.316 Nov 2022pre-release

    Nothing published for this version

  58. 4.7.0-integration-itx-pdp-remove-header.214 Nov 2022pre-release

    Nothing published for this version

  59. 4.7.0-integration-itx-pdp-remove-header.114 Nov 2022pre-release

    Nothing published for this version

  60. 4.7.0-integration-engines-4-7-0-9-feat-error-req-idx-26e00ab332793084ea0280df387b126fb5e17eba.111 Nov 2022pre-release

    Nothing published for this version