Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Simplify affected rows handling in PostgreSQL backend #1202

Merged
merged 3 commits into from
Jan 30, 2025

Conversation

vadz
Copy link
Member

@vadz vadz commented Jan 30, 2025

No real changes, just more cleanup.

vadz added 3 commits January 30, 2025 20:04
There is no need to test if rowsAffectedBulk_ is positive before
returning it, as we return -1 otherwise anyhow -- so we can just as well
return it directly.

No real changes.
This is just a tiny simplification, no real changes.
Just use rowsAffectedBulk_ normally, there doesn't seem to be any need
for this temporary variable and using it is fragile as it's easy to
forget to copy it into rowsAffectedBulk_ itself before returning.

This is similar to what was done in 42d5a2e (Fix get_affected_rows()
for partial updates in SQLite3 backend, 2025-01-28) for SQLite.
@vadz vadz merged commit 72f9616 into SOCI:master Jan 30, 2025
15 of 16 checks passed
@vadz vadz deleted the psql-affected-rows-simplify branch January 30, 2025 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant