akkudoktoreos.core.coreabc.get_database

akkudoktoreos.core.coreabc.get_database(init: bool = False) Database

Retrieve the singleton EOS database instance.

This function provides access to the global EOS Database instance. The instance is created on first access if init is True. If the instance is accessed before initialization and init is False, a RuntimeError is raised.

Parameters:

init (bool) – If True, create the Database instance if it does not exist. Default is False.

Returns:

The global EOS database instance.

Return type:

Database

Raises:

RuntimeError – If accessed before initialization with init=False.

Usage:
db = get_database(init=True)  # Initialize and retrieve
db.insert_measurement(...)