diff --git a/CHANGELOG.md b/CHANGELOG.md index 11b768a..994c1ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [2.2.0] - 2026-07-12 ### Summary + Add Postgres table adapter with TableRepositoryInterface ### Changed + - b37b2e6 Merge pull request '[minor] Add Postgres table adapter with TableRepositoryInterface' (#58) from cursor/postgres-table-adapter into main - 1babb52 Apply ruff formatting to postgres adapter and tests. - 63ee17d Apply prettier formatting to README and CHANGELOG. diff --git a/README.md b/README.md index d791918..0889530 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ Subclass an adapter in your own repository to add domain-specific methods while ## Architecture -| Layer | Responsibility | -| ---------------- | ------------------------------------------------------------------------------------------------------- | -| **Interfaces** | Abstract contracts for connection, context, CRUD, and queues | +| Layer | Responsibility | +| ---------------- | ---------------------------------------------------------------------------------------------------- | +| **Interfaces** | Abstract contracts for connection, context, CRUD, and queues | | **Adapters** | Technology-specific base classes (`RedisAdapter`, `MinioAdapter`, `PostgresAdapter`, queue adapters) | -| **Your project** | Subclass an adapter and add domain methods | +| **Your project** | Subclass an adapter and add domain methods | Each public interface is a `@runtime_checkable` `Protocol` with `@abstractmethod` members. **Subclass an adapter** when you need connection management and shared behavior — explicit subclasses get runtime instantiation guards and inherited default methods (e.g. `scan_keys`). **Type-annotate against an interface** when you want loose coupling — any object with the right methods satisfies the contract for mypy and `isinstance()` checks, without inheriting from this package. @@ -80,15 +80,15 @@ Requires PostgreSQL 10 or later; tested against PostgreSQL 16 in CI. Tables are In-process and disk-backed FIFO queues for buffering dict items. No optional extra required. -| Adapter | Role | -| ------------------------ | -------------------------------------------------------------------- | -| `MemoryQueueAdapter` | Thread-safe in-memory buffer with optional dedup and age eviction | +| Adapter | Role | +| ------------------------ | --------------------------------------------------------------------------------- | +| `MemoryQueueAdapter` | Thread-safe in-memory buffer with optional dedup and age eviction | | `FileBackedQueueAdapter` | Mirrors memory to a JSONL file; replays on `connect()`, compacts on dequeue/evict | -| Environment variable | Description | -| ---------------------------- | -------------------------------------------------------- | -| `FILE_QUEUE_PATH` | Path to the JSONL queue file | -| `FILE_QUEUE_MAX_AGE_HOURS` | Retention window in hours (default: `24`) | +| Environment variable | Description | +| -------------------------- | ----------------------------------------- | +| `FILE_QUEUE_PATH` | Path to the JSONL queue file | +| `FILE_QUEUE_MAX_AGE_HOURS` | Retention window in hours (default: `24`) | Dedup keys and the age field name are domain-specific: pass them when constructing `FileQueueConfig` (or as kwargs to `FileQueueConfig.from_env(...)`). Callers choose the file path and item schema.