MCPcopy Create free account
hub / github.com/HKUDS/OpenSpace / clear

Method clear

openspace/skill_engine/store.py:1189–1203  ·  view source on GitHub ↗

Delete all data (keeps schema).

(self)

Source from the content-addressed store, hash-verified

1187
1188 # Maintenance
1189 def clear(self) -> None:
1190 """Delete all data (keeps schema)."""
1191 self._ensure_open()
1192 with self._mu:
1193 self._conn.execute("BEGIN")
1194 try:
1195 # CASCADE on skill_records cleans up: lineage_parents, tool_deps, tags
1196 self._conn.execute("DELETE FROM skill_records")
1197 # execution_analyses CASCADE cleans up skill_judgments
1198 self._conn.execute("DELETE FROM execution_analyses")
1199 self._conn.commit()
1200 logger.info("SkillStore cleared")
1201 except Exception:
1202 self._conn.rollback()
1203 raise
1204
1205 def vacuum(self) -> None:
1206 """Compact the database file."""

Callers 3

discoverMethod · 0.45
wait_backgroundMethod · 0.45
clear_cacheMethod · 0.45

Calls 3

_ensure_openMethod · 0.95
infoMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected