Prisma: 2.0.0-beta.6 Release

Release date:
May 26, 2020
Previous version:
2.0.0-beta.5 (released May 11, 2020)
Magnitude:
2,388 Diff Delta
Contributors:
6 total committers
Data confidence:
Commits:

86 Commits in this Release

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

Authored May 14, 2020
Authored May 13, 2020
Authored May 12, 2020
Authored May 25, 2020
Authored May 18, 2020
Authored May 18, 2020
Authored May 12, 2020
Authored April 27, 2020
Authored May 15, 2020
Authored May 25, 2020
Authored May 19, 2020
Authored May 25, 2020
Authored May 26, 2020
Authored May 24, 2020
Authored May 25, 2020
Authored May 25, 2020
Authored May 14, 2020
Authored May 18, 2020
Authored May 26, 2020
Authored May 14, 2020
Authored May 26, 2020

Top Contributors in 2.0.0-beta.6

timsuchanek
Jolg42
zachasme
thankwsx
renovate-bot
prisma-bot

Directory Browser for 2.0.0-beta.6

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 sixth Beta release: 2.0.0-beta.6 (short: beta.6).

More powerful raw queries with Prisma Client

Thanks to @zachasme and @Sytten, the prisma.raw command became more powerful in https://github.com/prisma/prisma/pull/2311. There are two changes we introduce for raw:

Expose sql-template-tag helpers

Prisma Client's raw mode utilizes the sql-template-tag library. In order to construct raw SQL queries programmatically, Prisma Client now exposes a few helper functions:

import { sql, empty, join, raw, PrismaClient } from '@prisma/client'

const prisma = new PrismaClient()

const rawQueryTemplateFromSqlTemplate = await prisma.raw(
  sql`
    SELECT ${join([raw('email'), raw('id'), raw('name')])}
    FROM ${raw('User')}
    ${sql`WHERE name = ${'Alice'}`}
    ${empty}
  `
)

Allowing programmatic positional parameters

Sometimes, a static template string is not enough. Then constructing a string dynamically is the right choice. For this situation, we added support for arbitrary positional parameters:

const result = await prisma.raw(
  'SELECT * FROM User WHERE id = $1 OR email = $2;',
  1,
  '[email protected]'
)

Other improvements

  • You can now enable pgBouncer in your connection URL by adding the ?pgbouncer=true parameter (forceTransactions from the PrismaClient is now deprecated and will be removed in an upcoming release)
  • Improved handling of comments in prisma format
  • Various improvements to Prisma's VS Code extension (e.g. better error messages and debug information)

Fixes and improvements

prisma

prisma-client-js

vscode

prisma-engines

Credits

Huge thanks to @Sytten, @thankwsx, @zachasme for helping!