No-op update with empty input #184
Closed
IlyaSemenov
started this conversation in
Ideas
Replies: 1 comment
-
Solved here: #185 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have this kind of boilerplate everywhere:
I was thinking, what if ORM could do the check for me instead, and do a no-op update for an empty object?
Basically, that will mean that an empty update object will generate
select count(*)
instead ofupdate
, and generateselect *
instead ofupdate ... returning *
. Is that too magicky? Could it perhaps live in a dedicated method such as.updateOrSelect
? (I don't like this particular name, just speculating.)Just in case, currently an empty update simply generates invalid SQL:
Beta Was this translation helpful? Give feedback.
All reactions