Closed jmalloc closed 6 years ago
What should happen if the number of affected rows is 0
or some other less than expected number?
What should happen with errors when trying to get number of affected rows?
There's an example of how to do this in PR #101: https://github.com/jmalloc/ax/blob/b6deec3bcd151dfabc62cdea8ffabe18d7eb6431/src/axmysql/saga/crud.go#L208
I've checking for == 0
there, but it'd probably be better to check specifically for != 1
, when it's expected to update exactly one row.
BTW, we could put this in a helper function in axmysql/internal
, something like updateOneRow(ctx, q, ...)