MCPcopy Index your code
hub / github.com/idank/explainshell / _upsert_raw_manpage

Method _upsert_raw_manpage

explainshell/store.py:458–472  ·  view source on GitHub ↗

Insert or replace a RawManpage into the manpages table.

(self, source: str, raw: RawManpage)

Source from the content-addressed store, hash-verified

456 self._conn.commit()
457
458 def _upsert_raw_manpage(self, source: str, raw: RawManpage) -> None:
459 """Insert or replace a RawManpage into the manpages table."""
460 self._conn.execute(
461 """INSERT OR REPLACE INTO manpages(source, data, generated_at, generator,
462 generator_version, source_gz_sha256)
463 VALUES (?, ?, ?, ?, ?, ?)""",
464 (
465 source,
466 _compress(raw.source_text),
467 raw.generated_at.isoformat(),
468 raw.generator,
469 raw.generator_version,
470 raw.source_gz_sha256,
471 ),
472 )
473
474 def add_manpage(self, m: ParsedManpage, raw: RawManpage) -> ParsedManpage:
475 """add `m` into the store, if it exists first remove it and its mappings

Callers 1

add_manpageMethod · 0.95

Calls 1

_compressFunction · 0.85

Tested by

no test coverage detected