Skip to content

SQLite Cache

SQLiteCache(path: Path | None = None, expiry: int | None = 14)

The SQLiteCache object to cache search results from League of Comic Geeks.

PARAMETER DESCRIPTION
path

Path to database.

TYPE: Path | None DEFAULT: None

expiry

How long to keep cache results.

TYPE: int | None DEFAULT: 14

ATTRIBUTE DESCRIPTION
expiry

How long to keep cache results.

TYPE: int | None

connection

Database connection

TYPE: Connection

Functions

delete() -> None

Remove all expired data from the cache database.

insert(query: str, response: dict[str, Any]) -> None

Insert data into the cache database.

PARAMETER DESCRIPTION
query

Search string

TYPE: str

response

Data to save

TYPE: dict[str, Any]

select(query: str) -> dict[str, Any]

Retrieve data from the cache database.

PARAMETER DESCRIPTION
query

Search string

TYPE: str

Returns: Empty dict or select results.