feat(session): Postgres SessionRegistry — postgres parity (v26.06.68)#95
Merged
Conversation
…ssionRegistry from ports + bump v26.06.68 PostgresSessionRegistry (session/adapters/postgres_registry.py): durable, queryable, cross-process session-concurrency registry over a Postgres table (session_id PK, principal, created_at). Selected via pyfly.session.concurrency.registry=postgres -> clustered maximumSessions with no Redis. Table created lazily+idempotently; table name validated against injection. Hexagonal: AsyncEngine resolved lazily + injected by the composition root; no module-scope sqlalchemy. SessionRegistry now exported from pyfly.session.ports (audit consistency fix). Tests: tests/session/test_postgres_registry.py (6, SQL-recording fake) + tests/integration/ test_postgres_session_registry_integration.py (real Postgres: upsert/oldest-first/count/deregister, PASSED). Gates: mypy --strict (633), ruff + format, full suite 3932 passed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Extends session concurrency control to Postgres (the audit's session Postgres-parity item).
PostgresSessionRegistryis a durable, queryable, cross-process registry backed by a Postgres table (session_idPK,principal,created_at), selected viapyfly.session.concurrency.registry=postgres— clusteredmaximumSessionswith no Redis.AsyncEngineis resolved lazily + injected by the composition root; the adapter imports no SQLAlchemy at module scope.SessionRegistrynow exported frompyfly.session.ports(audit consistency fix).