Skip to content

Implement RETURNING on updateMany() so it can return data (instead of just count) #5019

@tvvignesh

Description

@tvvignesh

Hi there. Currently methods like updateOne and findOne takes only unique attributes in the where clause. The problem is, you need not always have a unique/primary key on a record which you want to find.

Its inconvenient since I have to use methods like updateMany when doing this which does not return me the updated records, but just the count. Also due to the fact that composite primary keys are not implemented yet (https://github.com/prisma/photonjs/issues/339) its kind of inconvenient since a single column is many times not unique.

Right now, when using updateMany, I have to do updateMany to first update the records and then a findMany query to get the records leading to 2 queries since when doing updates, you often don't receive all inputs from users but only specific fields they want to update, but you want all the results as the response post the update.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions