Skip to content
Discussion options

You must be logged in to vote

so the unit of work checks the number of rows matched to ensure it matches how many objects it worked on in the first place. so if you are confirming rows matched (as opposed to "definitely changed the value of is_alive"), the UOW does that for you since it is updating on primary key and will error out if any of those primary keys are not present. that is, len(all_parents) is the number of rows matched if the commit succeeds.

if you are looking for confirmation that is_alive was different first, then changed value, while MySQL does support an UPDATE mode that returns this for an UPDATE statement, that is, will give you number of rows changed from an update, SQLAlchemy turns that mode off …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dimitarOnGithub
Comment options

Answer selected by dimitarOnGithub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants