Skip to content

Base#

DatabaseBuilder #

Bases: abc.ABC

Database Builder

The base builder, for creating a Database Instance.

connect abstractmethod async #

connect() -> None

Connect to the database

Make the connection to the database.

RAISES DESCRIPTION
DatabaseConnectionException

Raised when the database fails to connect properly.

shutdown abstractmethod async #

shutdown() -> None

Shutdown the database

Allows for safely shutting down the database.

RAISES DESCRIPTION
DatabaseShutdownException

Raised when an error occurs shutting down the database.

add abstractmethod async #

add(timer: Timer) -> None

Add a timer to the database

Add a new timer to your database.

PARAMETER DESCRIPTION
timer

The timer you wish to add.

TYPE: Timer

RAISES DESCRIPTION
DatabaseUniqueException

a name/key value already exists of this type.

fetch abstractmethod async #

fetch(name: str, key: str) -> Timer | None

Fetch a timer

Fetch a timer, via its name and key.

PARAMETER DESCRIPTION
name

The name of the function, the Timer is attached too.

TYPE: str

key

The key of the Timer

TYPE: str

RETURNS DESCRIPTION
Timer

If a valid timer exists, it will return a timer.

fetch_all abstractmethod async #

fetch_all() -> t.Sequence[Timer] | None

Fetch all timers

Fetch every single timer from the database.

RETURNS DESCRIPTION
typing.Sequence[Timer]

The list of Timers from the database.

delete abstractmethod async #

delete(name: str, key: str) -> None

Delete a timer

Delete a specific timer from the database.

PARAMETER DESCRIPTION
name

The name of the function, the Timer is attached too.

TYPE: str

key

The key of the Timer

TYPE: str

delete_all abstractmethod async #

delete_all(name: str) -> None

Delete All Timers from a specific function name.

PARAMETER DESCRIPTION
name

The name of the function, the Timer is attached too.

TYPE: str

clear abstractmethod async #

clear() -> None

Clear Timers

Clear All timers present in the database.