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

Method load_all

openspace/skill_engine/store.py:687–707  ·  view source on GitHub ↗

Load skill records, keyed by ``skill_id``. Args: active_only: If True, only return records with ``is_active=True``.

(
        self, *, active_only: bool = False
    )

Source from the content-addressed store, hash-verified

685
686 @_db_retry()
687 def load_all(
688 self, *, active_only: bool = False
689 ) -> Dict[str, SkillRecord]:
690 """Load skill records, keyed by ``skill_id``.
691
692 Args:
693 active_only: If True, only return records with ``is_active=True``.
694 """
695 with self._reader() as conn:
696 if active_only:
697 rows = conn.execute(
698 "SELECT * FROM skill_records WHERE is_active=1"
699 ).fetchall()
700 else:
701 rows = conn.execute("SELECT * FROM skill_records").fetchall()
702 result: Dict[str, SkillRecord] = {}
703 for row in rows:
704 rec = self._to_record(conn, row)
705 result[rec.skill_id] = rec
706 logger.info(f"Loaded {len(result)} skill records (active_only={active_only})")
707 return result
708
709 @_db_retry()
710 def load_active(self) -> Dict[str, SkillRecord]:

Callers 6

load_activeMethod · 0.95
overviewFunction · 0.45
list_skillsFunction · 0.45
skill_statsFunction · 0.45
_build_lineage_payloadFunction · 0.45
build_local_candidatesFunction · 0.45

Calls 4

_readerMethod · 0.95
_to_recordMethod · 0.95
infoMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected