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.4.0-dev.5622 Sept 2022pre-release

    Nothing published for this version

  2. 4.4.0-dev.5521 Sept 2022pre-release

    Nothing published for this version

  3. 4.4.0-dev.5421 Sept 2022pre-release

    Nothing published for this version

  4. 4.4.0-dev.5321 Sept 2022pre-release

    Nothing published for this version

  5. 4.4.0-dev.5221 Sept 2022pre-release

    Nothing published for this version

  6. 4.4.0-dev.5120 Sept 2022pre-release

    Nothing published for this version

  7. 4.4.0-dev.5020 Sept 2022pre-release

    Nothing published for this version

  8. 4.4.0-dev.4920 Sept 2022pre-release

    Nothing published for this version

  9. 4.4.0-dev.4820 Sept 2022pre-release

    Nothing published for this version

  10. 4.4.0-dev.4720 Sept 2022pre-release

    Nothing published for this version

  11. 4.4.0-dev.4619 Sept 2022pre-release

    Nothing published for this version

  12. 4.4.0-dev.4519 Sept 2022pre-release

    Nothing published for this version

  13. 4.4.0-dev.4418 Sept 2022pre-release

    Nothing published for this version

  14. 4.4.0-dev.4315 Sept 2022pre-release

    Nothing published for this version

  15. 4.4.0-dev.4215 Sept 2022pre-release

    Nothing published for this version

  16. 4.4.0-dev.4114 Sept 2022pre-release

    Nothing published for this version

  17. 4.4.0-dev.4014 Sept 2022pre-release

    Nothing published for this version

  18. 4.4.0-dev.3914 Sept 2022pre-release

    Nothing published for this version

  19. 4.4.0-dev.3813 Sept 2022pre-release

    Nothing published for this version

  20. 4.4.0-dev.3712 Sept 2022pre-release

    Nothing published for this version

  21. 4.4.0-dev.369 Sept 2022pre-release

    Nothing published for this version

  22. 4.4.0-dev.359 Sept 2022pre-release

    Nothing published for this version

  23. 4.4.0-dev.348 Sept 2022pre-release

    Nothing published for this version

  24. 4.4.0-dev.338 Sept 2022pre-release

    Nothing published for this version

  25. 4.4.0-dev.327 Sept 2022pre-release

    Nothing published for this version

  26. 4.4.0-dev.317 Sept 2022pre-release

    Nothing published for this version

  27. 4.4.0-dev.307 Sept 2022pre-release

    Nothing published for this version

  28. 4.4.0-dev.297 Sept 2022pre-release

    Nothing published for this version

  29. 4.4.0-dev.286 Sept 2022pre-release

    Nothing published for this version

  30. 4.4.0-dev.276 Sept 2022pre-release

    Nothing published for this version

  31. 4.4.0-dev.266 Sept 2022pre-release

    Nothing published for this version

  32. 4.4.0-dev.255 Sept 2022pre-release

    Nothing published for this version

  33. 4.4.0-dev.245 Sept 2022pre-release

    Nothing published for this version

  34. 4.4.0-dev.235 Sept 2022pre-release

    Nothing published for this version

  35. 4.4.0-dev.223 Sept 2022pre-release

    Nothing published for this version

  36. 4.4.0-dev.212 Sept 2022pre-release

    Nothing published for this version

  37. 4.4.0-dev.202 Sept 2022pre-release

    Nothing published for this version

  38. 4.4.0-dev.192 Sept 2022pre-release

    Nothing published for this version

  39. 4.4.0-dev.182 Sept 2022pre-release

    Nothing published for this version

  40. 4.4.0-dev.172 Sept 2022pre-release

    Nothing published for this version

  41. 4.4.0-dev.161 Sept 2022pre-release

    Nothing published for this version

  42. 4.4.0-dev.151 Sept 2022pre-release

    Nothing published for this version

  43. 4.4.0-dev.141 Sept 2022pre-release

    Nothing published for this version

  44. 4.4.0-dev.131 Sept 2022pre-release

    Nothing published for this version

  45. 4.4.0-dev.121 Sept 2022pre-release

    Nothing published for this version

  46. 4.4.0-dev.1131 Aug 2022pre-release

    Nothing published for this version

  47. 4.4.0-dev.1031 Aug 2022pre-release

    Nothing published for this version

  48. 4.4.0-dev.931 Aug 2022pre-release

    Nothing published for this version

  49. 4.4.0-dev.831 Aug 2022pre-release

    Nothing published for this version

  50. 4.4.0-dev.731 Aug 2022pre-release

    Nothing published for this version

  51. 4.4.0-dev.631 Aug 2022pre-release

    Nothing published for this version

  52. 4.4.0-dev.531 Aug 2022pre-release

    Nothing published for this version

  53. 4.4.0-dev.431 Aug 2022pre-release

    Nothing published for this version

  54. 4.4.0-dev.331 Aug 2022pre-release

    Nothing published for this version

  55. 4.4.0-dev.230 Aug 2022pre-release

    Nothing published for this version

  56. 4.4.0-dev.130 Aug 2022pre-release

    Nothing published for this version

  57. 4.3.11 Sept 2022
    Release notes

    Today, we are issuing the 4.3.1 patch release.

    Fixes in Prisma Client

    Fixes in Prisma CLI

    Open source →
  58. 4.3.1-dev.11 Sept 2022pre-release

    Nothing published for this version

  59. 4.3.030 Aug 2022
    Release notes

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

    Major improvements

    Field reference support on query filters (Preview)

    We're excited to announce Preview support for field references. You can enable it with the fieldReference Preview feature flag.

    Field references will allow you to compare columns against other columns. For example, given the following schema:

    generator client {
      provider        = "prisma-client-js"
      previewFeatures = ["fieldReference"]
    }
    
    model Invoice {
      id     Int @id @default(autoincrement)
      paid   Int
      due    Int
    }
    

    You can now compare one column with another after running prisma generate, for example:

    // Filter all invoices that haven't been paid yet
    await prisma.invoice.findMany({
      where: {
        paid: {
          lt: prisma.invoice.fields.due // paid < due
        }
      }
    })
    

    Learn more about field references in our documentation. Try it out and let us know what you think in this GitHub issue.

    Count by filtered relation (Preview)

    In this release, we're adding support for the ability to count by a filtered relation. You can enable this feature by adding the filteredRelationCount Preview feature flag.

    Given the following Prisma schema:

    generator client {
      provider        = "prisma-client-js"
      previewFeatures = ["filteredRelationCount"]
    }
    
    model User {
      id    Int     @id @default(autoincrement())
      email String  @unique
      name  String?
      posts Post[]
    }
    
    model Post {
      id        Int      @id @default(autoincrement())
      title     String
      content   String?
      published Boolean  @default(false)
    
      author    User?    @relation(fields: [authorId], references: [id])
      authorId  Int?
    }
    

    You can now express the following query with the Preview feature after re-generating Prisma Client:

    // Count all user posts with the title "Hello!"
    await prisma.user.findMany({
      select: {
        _count: {
          select: {
            posts: { where: { title: 'Hello!' } },
          },
        },
      },
    })
    

    Learn more in our documentation and let us know what you think in this issue

    Multi-schema support (Preview)

    In this release, we're adding very early Preview support of multi-schema support for PostgreSQL and SQL Server behind the multiSchema Preview feature flag. With it, you can write a Prisma schema that accesses models across multiple schemas.

    Read further in this GitHub issue. Try it out and let us know what you think in this GitHub issue.

    Prisma CLI exit code fixes

    We've made several improvements to the Prisma CLI:

    • prisma migrate dev previously returned a successful exit code (0) when prisma db seed was triggered but failed due to an error. We've fixed this and prisma migrate dev will now exit with an unsuccessful exit code (1) when seeding fails.

    • prisma migrate status previously returned a successful exit code (0) in unexpected cases. The command will now exit with an unsuccessful exit code (1) if:

      • An error occurs
      • There's a failed or unapplied migration
      • The migration history diverges from the local migration history (/prisma/migrations folder)
      • Prisma Migrate does not manage the database' migration history
    • The previous behavior when canceling a prompt by pressing <kbd>Ctrl</kbd> + <kbd>C</kbd> was returning a successful exit code (0). It now returns a non-successful, SIGINT, exit code (130).

    • In the rare event of a Rust panic from the Prisma engine, the CLI now asks you to submit an error report and exit the process with a non-successful exit code (1). Prisma previously ended the process with a successful exit code (0).

    Improved precision for the tracing Preview feature

    Before this release, you may have occasionally seen some traces that took 0μs working with the tracing Preview feature. In this release, we've increased the precision to ensure you get accurate traces.

    Let us know if you run into any issues in this GitHub issue.

    prisma format now uses a Wasm module

    Initially, the prisma format command relied on logic from the Prisma engines in form of a native binary. In an ongoing effort to make prisma more portable and easier to maintain, we decided to shift to a Wasm module.

    prisma format now uses the same Wasm module as the one the Prisma language server uses, i.e. @prisma/prisma-fmt-wasm, which is now visible in prisma version command's output.

    Let us know what you think. In case you run into any issues, let us know by creating a GitHub issue.

    MongoDB query fixes

    ⚠️ This may affect your query results if you relied on this buggy behavior in your application.

    While implementing field reference support, we noticed a few correctness bugs in our MongoDB connector that we fixed along the way:

    1. mode: insensitive alphanumeric comparisons (e.g. “a” > “Z”) didn’t work (GitHub issue)
    2. mode: insensitive didn’t exclude undefined (GitHub issue)
    3. isEmpty: false on lists types (e.g. String[]) returned true when a list is empty (GitHub issue)
    4. hasEvery on list types wasn’t aligned with the SQL implementations (GitHub issue)

    JSON filter query fixes

    ⚠️ This may affect your query results if you relied on this buggy behavior in your application. We also noticed a few correctness bugs in when filtering JSON values when used in combination with the NOT condition. For example:

    await prisma.log.findMany({
      where: {
        NOT: {
          meta: {
            string_contains: "GET"
          }
        }
      }
    })
    

    <details>

    <summary>Prisma schema</summary>

    model Log {
      id      Int  @id @default(autoincrement())
      level   Level
      message String
      meta    Json
    }
    
    enum Level {
      Info
      Warn
      Error
    }
    

    </details>

    If you used NOT with any of the following queries on a Json field, double-check your queries to ensure they're returning the correct data:

    • string_contains
    • string_starts_with
    • string_ends_with
    • array_contains
    • array_starts_with
    • array_ends_with
    • gt/gte/lt/lte

    Prisma extension for VS Code improvements

    The Prisma language server now provides Symbols in VS Code. This means you can now:

    • See the different blocks (datasource, generator, model, enum, and type) of your Prisma schema in the Outline view. This makes it easier to navigate to a block in 1 click A few things to note about the improvement are that:

      • <kbd>CMD</kbd> + hover on a field whose type is an enum will show the block in a popup
      • <kbd>CMD</kbd> + left click on a field whose type is a model or enum will take you to its definition.

      <img alt="" src="https://user-images.githubusercontent.com/33921841/187421410-cd1f30cf-d0b4-4147-9467-70ca4da12321.png">

    • Enable Editor sticky scroll from version 1.70 of VS Code. This means you can have sticky blocks in your Prisma schema, improving your experience when working with big schema files

    Make sure to update your VS Code application to 1.70, and the Prisma extension to 4.3.0.

    We'd also like to give a big Thank you to @yume-chan for your contribution!

    Prisma Studio improvements

    We've made several improvements to the filter panel which includes:

    • Refined filter panel

      • Reducing the contrast of the panel in dark mode
      • Ability to toggle filters in the panel
    • Refined error handling for MongoDB m-n relations Prisma Studio prevents fatal errors when interacting with m-n relations by explicitly disabling creating, deleting, or editing records for m-n relations

    • Multi-row copying You can select multiple rows and copy them to your clipboard as JSON objects using <kbd>CMD</kbd> + <kbd>C</kbd> on MacOS or <kbd>Ctrl</kbd> + <kbd>C</kbd> on Windows/ Linux

    Prisma Client Extensions: request for comments

    For the last couple of months, we've been working on a specification for an upcoming feature — Prisma Client extensions. We're now ready to share our proposed design and we would appreciate your feedback.

    Prisma Client Extensions aims to provide a type-safe way to extend your existing Prisma Client instance. With Prisma Client Extensions you can:

    • Define computed fields
    • Define methods for your models
    • Extend your queries
    • Exclude fields from a model ... and much more!

    Here’s a glimpse at how that will look:

    const prisma = new PrismaClient().$extend({
      $result: {
        User: {
          fullName: (user) => {
            return `${user.firstName} ${user.lastName}`
          },
        },
      },
      $model: {
        User: {
          signup: async ({ firstName, lastName, email, password }) => {
            // validate and create the user here
            return prisma.user.create({ 
              data: { firstName, lastName, email, password }
            })
          },
        },
      },
    })
    
    const user = await prisma.user.signup({
      firstName: "Alice", 
      lastName: "Lemon", 
      email: "[email protected]", 
      password: "pri$mar0ckz"
    })
    console.log(user.fullName) // Alice Lemon
    

    For further details, refer to this GitHub issue. Have a read and let us know what you think!

    Fixes and improvements

    Prisma Client

    Prisma

    Prisma Migrate

    Language tools (e.g. VS Code)

    Credits

    Huge thanks to @abenhamdine, @drzamich, @AndrewSouthpaw, @kt3k, @lodi-g, @Gnucki, @apriil15, @givensuman for helping!

    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!

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

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

    Open source →
  60. 4.3.0-integration-use-prisma-fmt-wasm-for-cli-format.1322 Aug 2022pre-release

    Nothing published for this version