Metadata-Version: 2.4
Name: openwright-postgres
Version: 0.3.0
Summary: PostgreSQL ledger backend for OpenWright — durable, multi-writer evidence.
License: Apache-2.0
Keywords: audit,evidence,ledger,openwright,postgres
Requires-Python: <3.15,>=3.10
Requires-Dist: openwright-core<0.7,>=0.6
Requires-Dist: psycopg[binary]>=3.1
Provides-Extra: test
Requires-Dist: openwright-conformance; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# openwright-postgres

A durable, multi-writer **PostgreSQL ledger backend** for
[OpenWright](https://github.com/allthingsN/openwright) — the production answer to
the file/sqlite single-writer limit.

```bash
pip install openwright openwright-postgres
openwright collector --ledger-backend "postgresql://user:pw@host:5432/evidence"
```

Or in code:

```python
from openwright.connectors import resolve_backend
from openwright.ledger import Ledger
ledger = Ledger(resolve_backend("openwright.ledger_backends", "postgresql://…"))
```

It uses core's append-only `SqlLedgerBackend` (DB-assigned IDENTITY column — no
`MAX(idx)+1` race, O(1)+indexed positional reads), so concurrent writers commit
gap-free, ordered, and verifiable. Crypto stays in core; this package only wires
storage. Produces evidence that controls were exercised — not a legal compliance
certification.
