prisma-client-go
prisma-client-go copied to clipboard
Restructure methods to sound more obvious
Right now the syntax is
.FindOne(...).Update(...)
While that results in one efficient query under the hood, it may not look like it.
To make this more obvious, we could revert to the previous API:
.UpdateOne(...).Data(...)
One question here is what we name the second parameter where the actual update happens; Data
is what I'd probably default to.
This would be a breaking change which everyone would need to adapt. I'm not sure if it's worth adding the new methods first and only deprecating the old methods.
I like this syntax. It is more aligned with the underlying query as your suggested. I would maybe change Data
to Values