Metadata-Version: 2.5
Name: ultima-scraper-db-archive
Version: 0.3.0
Summary: Archive database module hosted by the UltimaScraperDB runtime
Project-URL: Homepage, https://github.com/UltimaHoarder/UltimaScraperDBArchive
Project-URL: Repository, https://github.com/UltimaHoarder/UltimaScraperDBArchive
Project-URL: Issues, https://github.com/UltimaHoarder/UltimaScraperDBArchive/issues
Author-email: UltimaHoarder <21285176+UltimaHoarder@users.noreply.github.com>
License-Expression: AGPL-3.0-or-later
License-File: LICENSE
Requires-Python: <3.15,>=3.14
Requires-Dist: alembic<2,>=1.14
Requires-Dist: cryptography<51,>=50
Requires-Dist: psycopg[binary]<4,>=3.3
Requires-Dist: sqlmodel<1,>=0.0.24
Requires-Dist: ultima-scraper-api<4,>=3.0.0b5
Requires-Dist: ultima-scraper-core<1,>=0.1
Requires-Dist: ultima-scraper-db<1,>=0.5
Description-Content-Type: text/markdown

# UltimaScraperDBArchive

UltimaScraperDBArchive is the archive database module hosted by the domain-neutral
`ultima-scraper-db` runtime. It owns archive models and constructs `ArchiveAPI`;
it does not own engine or session lifecycle.

```python
from ultima_scraper_db import DatabaseConfig, DatabaseManager
from ultima_scraper_db_archive import USDBArchiveModule

mounted = await DatabaseManager().run(
    USDBArchiveModule(),
    DatabaseConfig(url=database_url),
)
archive_api = mounted.api
```

The package is PostgreSQL-only. Legacy SQLite models remain available solely
for migration compatibility.

## Packaged migration interface

`usdb-archive-migrate check|upgrade` is the only production schema writer for
`ultima_archive`. It reads a mode-0600 URL file, verifies the exact database,
rejects unknown revisions and privileged cluster roles, serializes with a
PostgreSQL advisory lock, and emits a JSON report.

```bash
usdb-archive-migrate check \
  --database-url-file /protected/archive_database_url \
  --expected-head d8f4b2a19c60

usdb-archive-migrate upgrade \
  --database-url-file /protected/archive_database_url \
  --expected-head d8f4b2a19c60
```

The expected head must exactly match the packaged single-head Alembic graph.
