MCPcopy Create free account
hub / github.com/Freedium-cfd/web / delete

Method delete

database-lib/database_lib/main.py:206–216  ·  view source on GitHub ↗
(self, key: str)

Source from the content-addressed store, hash-verified

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")

Callers 1

test_deleteMethod · 0.45

Calls 1

ensure_connectionMethod · 0.95

Tested by 1

test_deleteMethod · 0.36