GitHub

API reference for result.

What a driver's raw result (Statement.raw) says about a statement that changes rows, read the same way whatever the driver.

Classes

Functions

affected_rows

affected_rows(result) -> int

How many rows the statement of result changed; 0 when its driver's result does not count them.

ParameterTypeDescription
resultobject

Returns int

def affected_rows(result: object) -> int:
    """How many rows the statement of ``result`` changed; 0 when its
    driver's result does not count them."""
    return result.affected_rows if isinstance(result, RowCount) else 0