Database.fetch_latest_value

Database.fetch_latest_value(table_name: str, column_name: Optional[List[str]] = None)tuple[source]

Retrieves the latest values of a time-ordered table. If paramref:’column_name’ is not given, all values of the table are retrieved.

Parameters
  • table_name (str) – Name of the table where the column has to be retrieved from.

  • column_name (str) – Column[s] to be retrieved, default is all columns.

Returns

Latest data. First element is the time of the latest entry. Consecutive elements are the value of each column.

Return type

tuple

Raises

psycopg2.Error – Base exception for all kind of database errors.