Insert or replace a RawManpage into the manpages table.
(self, source: str, raw: RawManpage)
| 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 |
no test coverage detected