npm @prisma/client 2.0.0-beta.9

latest releases: 5.21.0-dev.3, 5.21.0-integration-itx-refactor.16, 5.21.0-integration-itx-refactor.15...
4 years ago

Today, we are issuing the ninth Beta release: 2.0.0-beta.9 (short: beta.9).

Enforcing arrays in OR

We used to allow this syntax:

  const orIncorrect = await prisma.post.findMany({
    orderBy: {
      id: 'asc'
    },
    where: {
      OR: {
        title: {
          equals: "Prisma makes databases easy"
        },
        authorId: {
          equals: 2
        }
      }
    }
  });

However, the thing that we want is this:

const orCorrect = await prisma.post.findMany({
   orderBy: {
     id: 'asc'
   },
   where: {
     OR: [{
       title: {
         equals: "Prisma makes databases easy"
       },
     }, {
       authorId: {
         equals: 2
       }
     }]
   }
 })

So only the array syntax makes sense, therefore we also only allow that from now on.

Fixes and improvements

prisma

prisma-client-js

vscode

prisma-engines

Credits

Huge thanks to @Sytten for helping!

Don't miss a new client release

NewReleases is sending notifications on new releases.