Skip to content

2.0.0-beta.9

Pre-release
Pre-release
Compare
Choose a tag to compare
@timsuchanek timsuchanek released this 08 Jun 15:23

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!