Prisma: 2.0.0-preview021 Release

Release date:
January 30, 2020
Previous version:
2.0.0-preview020.3 (released January 24, 2020)
Magnitude:
992 Diff Delta
Contributors:
9 total committers
Data confidence:
Commits:

36 Commits in this Release

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

Authored January 27, 2020
Authored January 30, 2020
Authored January 24, 2020
Authored January 28, 2020
Authored January 27, 2020
Authored January 24, 2020
Authored January 30, 2020
Authored January 27, 2020
Authored January 27, 2020
Authored January 24, 2020
Authored January 27, 2020
Authored January 28, 2020
Authored January 30, 2020
Authored January 28, 2020
Authored January 28, 2020
Authored January 30, 2020
Authored January 30, 2020
Authored January 27, 2020
Authored January 29, 2020
Authored January 28, 2020
Authored January 24, 2020
Authored January 29, 2020
Authored January 27, 2020
Authored January 30, 2020
Authored January 28, 2020
Authored January 28, 2020
Authored January 27, 2020
Authored January 30, 2020
Authored January 27, 2020
Authored January 30, 2020
Authored January 30, 2020

Top Contributors in 2.0.0-preview021

nikolasburk
timsuchanek
Jolg42
deadcoder0904
richardkall
Errorname
madebysid
kennhung
prisma-bot

Directory Browser for 2.0.0-preview021

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 twenty-first Preview release: 2.0.0-preview021 (short: preview021).

This release contains breaking changes, be sure to read the notes below before upgrading!

⚠️ If you're using Prisma together with GraphQL Nexus and nexus-prisma, check out the additional release notes of nexus-prisma: https://github.com/prisma-labs/nexus-prisma/releases/tag/0.9.0

Breaking changes

The property on the PrismaClient that exposes CRUD operations per model used to be lowercased and pluralized, the pluralization of that property is now removed.

For example, for a model User you'd access a CRUD operation via the generated prisma.users property, as in prisma.users.findMany(). As of preview021, the pluralization has been removed and the property is called after the model (but lowercased), so it would now be prisma.user.findMany().

Here are few more examples showing how the calls to your PrismaClient instance must be adjusted:

Prisma schema

model User {
  id    Int    @id @default(autoincrement())
  name  String
}

Generated Prisma Client API

const prisma = new PrismaClient()

// CRUD operations are exposed via:
- // prisma.users
+ // prisma.user

// findMany
- const users = await prisma.users.findMany()
+ const users = await prisma.user.findMany()

// findOne
- const user = await prisma.users.findOne({ where: { id: 1 }})
+ const user = await prisma.user.findOne({ where: { id: 1 }})

// create
- const user = await prisma.users.create({ data: { name: "Alice" }})
+ const user = await prisma.user.create({ data: { name: "Alice" }})

// and so on ... 

Improvements

Besides many small fixes, Prisma Client JS now uses JSDoc to bring API documentation to your fingertips as you write code in your editor:

image

Fixes and improvements per Prisma 2 repository

prisma2

prisma-client-js

migrate

prisma-engine