skytracker.storage.table_query.TableQuery#

class skytracker.storage.table_query.TableQuery#

Bases: Generic[EntryType]

Abstract table query

Properties

allows_cache

Whether this query can use cached data

Methods

from_cache

Query a list of states from cache

from_server

Query a list of states from server database

parse_table_row

Parse the raw table format into an entry

__init__()#
abstractmethod async from_cache(states: list[EntryType]) list[EntryType]#

Query a list of states from cache

Parameters:

states (list[EntryType]) – unfiltered list of states

Returns:

filtered list of states

Return type:

list[EntryType]

abstractmethod async from_server(table: str, db: DatabaseManager) list[EntryType]#

Query a list of states from server database

Parameters:
  • table (str) – name of database table

  • db (DatabaseManager) – database manager instance

Returns:

selected list of states

Return type:

list[EntryType]

abstractmethod parse_table_row(raw_entry: Any) EntryType#

Parse the raw table format into an entry

Parameters:

raw_entry (Any) – raw table row data

Returns:

corresponding entry instance

Return type:

EntryType

abstract property allows_cache: bool#

Whether this query can use cached data

Returns:

whether this query can use cached data

Return type:

bool