yarn @prisma/client 2.0.0-beta.4

latest releases: 5.14.0-dev.35, 5.14.0-dev.34, 5.14.0-integration-static-wasm-worker-loader.3...
4 years ago

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!

Don't miss a new client release

NewReleases is sending notifications on new releases.