zut.db.ResultManager

class zut.db.ResultManager(db: Db, sql: str | None = None, params: Mapping[str, Any] | Sequence[Any] | None = None, *, limit: int | None = None, offset: int | None = None, source: str | None = None, warn_if_result: bool | int | Literal['not-last'] = False)

Bases: object

__init__(db: Db, sql: str | None = None, params: Mapping[str, Any] | Sequence[Any] | None = None, *, limit: int | None = None, offset: int | None = None, source: str | None = None, warn_if_result: bool | int | Literal['not-last'] = False)

Methods

__init__(db[, sql, params, limit, offset, ...])

get_dict()

get_dicts()

get_row()

get_rows()

get_scalar()

get_scalars()

iter_dicts()

iter_rows()

iter_scalars()

print_tabulate(*[, file, max_length])

single_dict()

single_row()

single_scalar()

tabulate()

Attributes

columns

cursor

headers

lastrowid

The rowid of the last inserted row.

length

Return the number of rows in the result set.

next_num

rowcount

The number of rows modified by the last SQL statement.

property lastrowid

The rowid of the last inserted row. None if no inserted rowid.

property length: int

Return the number of rows in the result set.

To get the number of rows modified by the last SQL statement, use rowcount instead.

property rowcount: int | None

The number of rows modified by the last SQL statement. Has the value of -1 or None if the number of rows is unknown or unavailable.

To get the number of rows in the result set, use length instead.