skytracker.storage.storage.Storage#
- class skytracker.storage.storage.Storage(username: str, password: str, host: str = 'localhost', port: int = 8123, database: str = '__default__', secure: bool = False)#
Bases:
objectCentral access point for all tables
Methods
Initialize storage by creating database and table managers
Close connection to the database
Connect to the database and ensure all tables exist
Get the names of the available tables
- __init__(username: str, password: str, host: str = 'localhost', port: int = 8123, database: str = '__default__', secure: bool = False) None#
Initialize storage by creating database and table managers
- Parameters:
username (str) – server username
password (str) – server password
host (str, optional) – server host. Defaults to ‘localhost’.
port (int, optional) – server port. Defaults to 8123.
database (str, optional) – server database name. Defaults to ‘__default__’.
secure (bool, optional) – whether to use secure connection. Defaults to False.
- async close() None#
Close connection to the database
- async connect() None#
Connect to the database and ensure all tables exist
- tables() list[str]#
Get the names of the available tables
- Returns:
list of table names
- Return type:
list[str]