Skip to content

symfonic.platform.working_pg_reference

working_pg_reference

Closed opt-in PostgreSQL Working composition shared by POST and Agent.

PostgresWorkingReference

PostgresWorkingReference(graph, provider, guard, owner, *, sink, retention=100)

One exact graph/pool/HMS; caller session is authorized separately.

Construction never installs a schema or changes the public/default route. The caller must explicitly install the guard and session-owner table first.

Source code in src/symfonic/platform/working_pg_reference.py
def __init__(self, graph, provider, guard, owner, *, sink, retention=100):
    if (
        type(graph) is not PostgresGraphBackend
        or type(owner) is not PostgresWorkingOwner
        or graph.pool is not guard.pool
        or owner.pool is not graph.pool
        or owner.guard is not guard
    ):
        raise TypeError("PostgreSQL Working requires one exact guarded graph pool")
    self.graph, self.provider, self.guard, self.owner = graph, provider, guard, owner
    self.store = GraphBackedHms(graph)
    self.create = PostgresWorkingCreateService(
        self, graph, self.store, guard, owner, retention=retention, sink=sink,
    )
    self._agents, self._closed = {}, False