sql-kit icon indicating copy to clipboard operation
sql-kit copied to clipboard

Affect row count from insert, update and delete

Open shawnclovie opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. Some time I'd like to know how many rows changed after UPDATE statement executed, to control parallel access. e.g. SELECT id,update_time FROM TableA UPDATE TableA SET SOMETHING WHERE id=? AND update_time=? If no rows affected, the progress may retry.

Describe the solution you'd like I was used go-pg for golang, each execute function (Update, Insert, Delete) may return orm.Result, I can call RowsAffected() from it.

If I missed something, please let me know, thanks.

shawnclovie avatar Oct 12 '22 13:10 shawnclovie

This feature would be appreciated here as well.

If the team (@tanner0101 or @gwynne maybe?) could provide any pointer/hint about:

  • where this should be implemented for each driver
  • how the exposed API should look like

; I would be glad to help and provide an implementation.

abidon avatar Apr 11 '24 09:04 abidon