asyncqlio.orm.inspection

Inspection module - contains utilities for inspecting Table objects and Row objects.

Functions

get_pk(…) Gets the primary key for a Table row.
get_row_history(…) Gets the history for the specified row.
get_row_session(…) Gets the Session associated with a TableRow.
asyncqlio.orm.inspection.get_row_session(row: asyncqlio.orm.schema.table.Table) → asyncqlio.orm.session.Session[source]

Gets the Session associated with a TableRow.

Parameters:row – The Table instance to inspect.
asyncqlio.orm.inspection.get_row_history(row: asyncqlio.orm.schema.table.Table) → typing.Dict[asyncqlio.orm.schema.column.Column, typing.Dict[str, typing.Any]][source]

Gets the history for the specified row.

This returns a dict, indexed by Column, with values being another dict with old and new keys that represent the old and new values of the item.

asyncqlio.orm.inspection.get_pk(row: asyncqlio.orm.schema.table.Table, as_tuple: bool = True)[source]

Gets the primary key for a Table row.

Parameters:
  • row – The Table instance to extract the PK from.
  • as_tuple – Should this PK always be returned as a tuple?