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:
|
Source code in simyan/cache/sqlite_cache.py
| Python | |
|---|---|
21 22 23 24 25 | |
Functions
cleanup() -> None
Remove all expired entries from the cache database.
Source code in simyan/cache/sqlite_cache.py
| Python | |
|---|---|
97 98 99 100 101 102 103 104 | |
delete(query: str) -> None
Remove entry from the cache with the provided url.
| PARAMETER | DESCRIPTION |
|---|---|
query
|
Url string used as key.
TYPE:
|
Source code in simyan/cache/sqlite_cache.py
| Python | |
|---|---|
87 88 89 90 91 92 93 94 95 | |
initialize() -> None
Create the cache table if it doesn't exist.
Source code in simyan/cache/sqlite_cache.py
| Python | |
|---|---|
39 40 41 42 43 44 45 46 47 48 49 50 51 | |
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:
|
Source code in simyan/cache/sqlite_cache.py
| Python | |
|---|---|
73 74 75 76 77 78 79 80 81 82 83 84 85 | |
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. |
Source code in simyan/cache/sqlite_cache.py
| Python | |
|---|---|
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | |