Prisma: 2.0.0-beta.8 Release

Release date:
June 3, 2020
Previous version:
2.0.0-beta.7 (released May 29, 2020)
Magnitude:
735 Diff Delta
Contributors:
8 total committers
Data confidence:
Commits:

30 Commits in this Release

Ordered by the degree to which they evolved the repo in this version.

Authored June 2, 2020
Authored June 3, 2020
Authored June 2, 2020
Authored June 2, 2020
Authored June 2, 2020
Authored June 2, 2020
Authored June 3, 2020
Authored May 29, 2020
Authored June 2, 2020
Authored June 2, 2020
Authored June 2, 2020
Authored June 3, 2020

Top Contributors in 2.0.0-beta.8

timsuchanek
Jolg42
mhwelander
merelinguist
madebysid
nikolasburk
renovate-bot
prisma-bot

Directory Browser for 2.0.0-beta.8

We haven't yet finished calculating and confirming the files and directories changed in this release. Please check back soon.

Release Notes Published

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

Breaking change: Splitting .raw into .queryRaw and .executeRaw

When dealing with raw SQL queries, there are two things we care about - the "return payload", which is being calculated by the SELECT statement we use and the number of affected rows - if we for example do an UPDATE query.

Until now, Prisma Client decided under the hood with a heuristic, when to return the number of affected rows and when to return the result data. This heuristic broke if you wanted the opposite of what the heuristic returned. That means that the decision has to be made by the developer using Prisma Client instead. Therefore, we remove the raw command and replace it with executeRaw and queryRaw.

So what does return what? - executeRaw returns the number of affected rows - queryRaw returns the result data

The heuristic used to return the data for SELECT statements. So if you upgrade to Beta 8, you need to use queryRaw for your SELECT statements and executeRaw for all SQL queries, which mutate data.

The rule of thumb is: Do not use executeRaw for queries that return rows. In Postgres, it will work to use executeRaw('SELECT 1), however, SQLite will not allow that.

Fixes and improvements

prisma

prisma-client-js

Credits

Huge thanks to @Sytten, @merelinguist for helping!