mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-04-06 18:36:50 +00:00
Implements storage.Store for PostgreSQL using pgx/v5. Schema uses double-buffered generations per package — write into the inactive gen, then atomically swap the active pointer on Commit. Readers always see a complete consistent snapshot. Write path: BeginRefresh → Put (staged in-memory) → Commit (CopyFrom + swap) Read path: Load → reads active gen from webi_packages, fetches assets Both webid and webicached now accept -pg=<dsn> to use pgstore instead of fsstore. Schema is applied idempotently on startup. Also: - storage.Store interface gains ListPackages(ctx) — fsstore reads the directory; pgstore queries webi_packages - webid.loadAll() uses ListPackages instead of filepath.ReadDir - Fixed .gitignore: /webid (root binary) was incorrectly matching cmd/webid/