SQLite Cache
SQLiteCache
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 | |
|---|---|
26 27 28 29 30 | |
Functions
cleanup
Remove all expired entries from the cache database.
Source code in simyan/cache/sqlite_cache.py
| Python | |
|---|---|
129 130 131 132 133 134 135 136 137 138 139 | |
delete
Remove entry from the cache with the provided url.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
The URL used as the cache key.
TYPE:
|
Source code in simyan/cache/sqlite_cache.py
| Python | |
|---|---|
116 117 118 119 120 121 122 123 124 125 126 127 | |
initialize
Create the cache table if it doesn't exist.
Source code in simyan/cache/sqlite_cache.py
| Python | |
|---|---|
45 46 47 48 49 50 51 52 53 54 55 | |
insert
Insert data into the cache database.
If a record with the same url already exists it is overwritten (upsert semantics).
| PARAMETER | DESCRIPTION |
|---|---|
url
|
The URL used as the cache key.
TYPE:
|
response
|
The response body to store.
TYPE:
|
Source code in simyan/cache/sqlite_cache.py
| Python | |
|---|---|
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | |
select
Retrieve data from the cache database.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
The URL used as the cache key.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
CacheData | None
|
A |
Source code in simyan/cache/sqlite_cache.py
| Python | |
|---|---|
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |