(self)
| 164 | self.connection.execute("PRAGMA auto_vacuum=full") |
| 165 | |
| 166 | def init_db(self): |
| 167 | self.ensure_connection() |
| 168 | with self.connection: |
| 169 | self.cursor.execute( |
| 170 | "CREATE TABLE IF NOT EXISTS cache (key TEXT PRIMARY KEY, value TEXT)" |
| 171 | ) |
| 172 | # self.cursor.execute("CREATE INDEX IF NOT EXISTS idx_key ON cache (key)") |
| 173 | |
| 174 | def pull(self, key: str) -> Union[CacheResponse, None]: |
| 175 | self.ensure_connection() |