| 204 | ) |
| 205 | |
| 206 | def delete(self, key: str) -> None: |
| 207 | self.ensure_connection() |
| 208 | with self.connection: |
| 209 | result = self.cursor.execute( |
| 210 | "SELECT 1 FROM cache WHERE key = :0", {"0": key} |
| 211 | ).fetchone() |
| 212 | if result: |
| 213 | self.cursor.execute("DELETE FROM cache WHERE key = :0", {"0": key}) |
| 214 | logger.debug(f"Deleted key: {key}") |
| 215 | else: |
| 216 | logger.debug(f"Attempted to delete non-existing key: {key}") |
| 217 | |
| 218 | def _generate_test_data(self, num_rows: int, batch_size: int = 10000): |
| 219 | logger.info("Generating test data") |