summaryrefslogtreecommitdiff
path: root/requests_cache/backends/sqlite.py
diff options
context:
space:
mode:
authorJordan Cook <jordan.cook@pioneer.com>2021-04-27 16:26:46 -0500
committerJordan Cook <jordan.cook@pioneer.com>2021-04-27 23:19:45 -0500
commitcfd5c391f546e5e9cfaeb5a0339750f9a790325a (patch)
tree59e9a7356ae3dc27bf68e2ab29bdbf81e9a1f7ab /requests_cache/backends/sqlite.py
parent51cbd04e8f3af869fe57c7a57d15f40c04cc4dea (diff)
downloadrequests-cache-cfd5c391f546e5e9cfaeb5a0339750f9a790325a.tar.gz
Add BaseCache.keys() and values() methods
* Update `BaseCache.urls` to return a generator instead of the whole list at once (which may use too much memory for particularly large caches) * Update `BaseCache.urls` to just skip invalid responses instead of deleting them
Diffstat (limited to 'requests_cache/backends/sqlite.py')
-rw-r--r--requests_cache/backends/sqlite.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/requests_cache/backends/sqlite.py b/requests_cache/backends/sqlite.py
index 29ac083..5ad100a 100644
--- a/requests_cache/backends/sqlite.py
+++ b/requests_cache/backends/sqlite.py
@@ -27,7 +27,11 @@ class DbCache(BaseCache):
"""
def __init__(
- self, db_path: Union[Path, str] = 'http_cache', use_temp: bool = False, fast_save: bool = False, **kwargs
+ self,
+ db_path: Union[Path, str] = 'http_cache',
+ use_temp: bool = False,
+ fast_save: bool = False,
+ **kwargs,
):
super().__init__(**kwargs)
self.responses = DbPickleDict(db_path, table_name='responses', use_temp=use_temp, fast_save=fast_save, **kwargs)