Prisma: 2.0.0-beta.4 Release

Release date:
April 30, 2020
Previous version:
2.0.0-beta.3 (released April 21, 2020)
Magnitude:
3,514 Diff Delta
Contributors:
4 total committers
Data confidence:
Commits:

61 Commits in this Release

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

Authored April 23, 2020
Authored April 30, 2020
Authored April 29, 2020
Authored April 23, 2020
Authored April 24, 2020
Authored April 28, 2020
Authored April 29, 2020
Authored April 24, 2020
Authored April 22, 2020
Authored April 23, 2020
Authored April 23, 2020
Authored April 28, 2020
Authored April 28, 2020
Authored April 28, 2020
Authored April 24, 2020
Authored April 24, 2020
Authored April 24, 2020
Authored April 24, 2020

Top Contributors in 2.0.0-beta.4

Jolg42
timsuchanek
madebysid
prisma-bot

Directory Browser for 2.0.0-beta.4

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

Major improvements

Support for JSON types in PostgreSQL and MySQL

Prisma now supports working with JSON data with the new Json type in the Prisma data model.

Here's an overview of how it works with different Prisma tools/workflows:

Introspection

The prisma introspect command maps the following column types to Json:

  • Postgres: JSON and JSONB
  • MySQL: JSON

Prisma Migrate

prisma migrate uses the following data type when creating a column for a field of type Json:

  • Postgres: JSONB
  • MySQL: JSON

Prisma Client

Fields of type Json will be exposed as plain JavaScript objects in the Prisma Client API.

Introducing prisma format

From now on, you can run prisma format in your project, to make your schema.prisma pretty without the VSCode extension πŸ’…

Support for Yarn workspaces

Prisma now supports Yarn workspaces πŸŽ‰

Making Prisma Client generation more robust with .prisma folder

The generation of Prisma Client into node_modules sometimes caused problems with package managers (e.g. Yarn) which would occasionally delete the generated code.

In order to make the generation more robust, Prisma Client is now generated into a folder called node_modules/.prisma. Because of the leading dot in the folder name, package managers do not touch the folder any more. This results in the following folder structure:

node_modules/
 β†ͺ .prisma
   β†ͺ client
     β†ͺ schema.prisma
     β†ͺ index.js
     β†ͺ index.d.ts
     β†ͺ query-engine-darwin
 β†ͺ @prisma/client (imports the generated code from `.prisma`)

Note that the generated Prisma Client code in .prisma is now imported into @prisma/client which means there is no change for how you import and use Prisma Client in your code! You can still import Prisma Client as before with:

import { PrismaClient } from '@prisma/client'

Open Prisma Studio in specific browser

The prisma studio --experimental command now accepts a --browser option to let you choose your preferred browser for Prisma Studio, e.g.:

prisma studio --browser "Google Chrome" --experimental

Here's an overview of the browser names you can use per platform (note that double quotes are required when the browser name contains space and the right capitalization is required too):

| OS | Browser | Argument for --browser | | ------- | ------------------- | ----------------------------- | | Mac OS | Chrome | "Google Chrome" | | | Firefox | "Firefox" | | | Firefox (Developer) | "Firefox Developer Edition" | | | Safari | "Safari" | | Windows | Chrome | "Google Chrome" | | | Firefox | "Firefox" | | | Firefox (Developer) | "Firefox Developer Edition" | | | Brave | "Brave" | | Linux | Chrome | "google-chrome" | | | Firefox | "firefox" | | | Firefox (Developer) | "firefox-developer-edition" | | | Brave | "brave" |

Fixes and improvements

prisma

prisma-client-js

migrate

vscode

Credits

Huge thanks to @Sytten for helping!