SQLite Cache
SQLiteCache(path: Path | None = None, expiry: int | None = 14)
The SQLiteCache object to cache search results from Comicvine.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
Path to database.
TYPE:
|
expiry
|
How long to keep cache results.
TYPE:
|
Functions
cleanup() -> None
Remove all expired entries from the cache database.
delete(query: str) -> None
Remove entry from the cache with the provided url.
| PARAMETER | DESCRIPTION |
|---|---|
query
|
Url string used as key.
TYPE:
|
initialize() -> None
Create the cache table if it doesn't exist.
insert(query: str, response: dict[str, Any]) -> None
Insert data into the cache database.
| PARAMETER | DESCRIPTION |
|---|---|
query
|
Url string used as key.
TYPE:
|
response
|
Response dict from url.
TYPE:
|
select(query: str) -> dict[str, Any]
Retrieve data from the cache database.
| PARAMETER | DESCRIPTION |
|---|---|
query
|
Url string used as key.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict[str, Any]
|
Empty dict or select results. |