You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cool idea. The problem with this is that upsert can update multiple rows at once if the update criteria are open enough. So there would need to be handling for that case. Still, want to give it a shot?
UPDATE returns True if any rows where updated, else False.
UPSERT returns nothing.
So a consistent solution might be to return the ID on INSERT or a single UPDATE, True on multiple updates and False otherwise (on error). This also avoids the problem of having to guess if the return value is a ID or the numbers of rows changed.
Just started playing around with dataset and was thinking this would be nice. I keep writing small insert / update wrappers right now.
The text was updated successfully, but these errors were encountered: