Prisma-client-js: Remove compatibility plural api

Created on 11 Feb 2020  路  2Comments  路  Source: prisma/prisma-client-js

In order to ease the transition, Prisma Client right now ships with a note with the old plural api, that it's deprecated.
We should by now remove the note, as it gets in the way with the autocompletion.

kinimprovement

Most helpful comment

You refer to the old "pluralized API", not the "compatibility plural api" we had for a few versions that @timsuchanek mentioned above.

About the pluralized API:
The problem is if people already have pluralized table names like posts it created something like postes - which is _really_ awkward to use and non intuitive. Same problem in other, non English languages. Also if the table names for example use both way mixed at the same time. So for now we removed the feature. If you want to, you can use @map in your schema.prisma to rename the model (blog => blogs) which will also be reflects in Prisma Client.

We will think about how we can improve this experience in the future - we agree with your initial statement, but have to find a better way to offer that.

All 2 comments

Any reason why this is removed? It reads weirdly

// This reads weird
馃ぎ  const blogs = await prisma.blog.findMany()

// This reads greatly
馃槏  const blogs = await prisma.blogs.findMany()

You refer to the old "pluralized API", not the "compatibility plural api" we had for a few versions that @timsuchanek mentioned above.

About the pluralized API:
The problem is if people already have pluralized table names like posts it created something like postes - which is _really_ awkward to use and non intuitive. Same problem in other, non English languages. Also if the table names for example use both way mixed at the same time. So for now we removed the feature. If you want to, you can use @map in your schema.prisma to rename the model (blog => blogs) which will also be reflects in Prisma Client.

We will think about how we can improve this experience in the future - we agree with your initial statement, but have to find a better way to offer that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

williamluke4 picture williamluke4  路  3Comments

nikolasburk picture nikolasburk  路  3Comments

divyenduz picture divyenduz  路  4Comments

Errorname picture Errorname  路  3Comments

FluorescentHallucinogen picture FluorescentHallucinogen  路  3Comments