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
- Expose a logger interface
- Emit an error event when the database connection is interrupted
- Limit implicit m-n relations to primary keys only
- Rename pinnedPlatform to pinnedBinaryTarget
- @prisma/engine-core forces users to enable esModuleInterop
prisma-client-js
- findMany / OR accepts non-array value - should only accept arrays
- Queries and mutations stuck (runs forever?) if log option is ['query', 'warn']
vscode
prisma-engines
- Use exact id column type for the version check during introspection
- add
uniqueIndexes
to Model in DMMF - bring back
default
for Field in DMMF
Credits
Huge thanks to @Sytten for helping!