On Apr 24, 2014, at 10:55 AM, pr64 <pierrerot...@gmail.com> wrote:

> Hi,
> 
> I'm using SQA core to improve my app performance.
> 
> I'v got the following db update request:
> 
> engine.execute(Person.__table__.update().\
>                              where(Person.name == "peter").\
>                              values(is_stafff=True))
> 
> When "peter" does not exist, is there a means to check that the update failed 
> ? It seems to be silent (no exception) and I could not find such an 
> information in the returned ResultProxy object...


yes you look at "rowcount":

result = engine.execute(.. update statement ..)

assert result.rowcount == 1



> 
> Thanks,
> 
> Pierre
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to