Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Affect row count from insert, update and delete #155

Open
shawnclovie opened this issue Oct 12, 2022 · 2 comments
Open

Affect row count from insert, update and delete #155

shawnclovie opened this issue Oct 12, 2022 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@shawnclovie
Copy link

shawnclovie commented Oct 12, 2022

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 shawnclovie added the enhancement New feature or request label Oct 12, 2022
@abidon
Copy link

abidon commented Apr 11, 2024

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.

@Supereg
Copy link

Supereg commented Nov 27, 2024

Wanted to chime in if there is any progress on this? Are there any workarounds to achieve similar results?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants