For when there's an existing connection that is not controlled by session. This facilitates integration with other elements that are Postgres-based, and a single transaction has to be used to bound message writes and other extraneous, external Postgres operations.
Consider making the session's connection attribute read-only, and only allow injection from construction. But then the rest of the implementation would have to make use of the @session instance variable. That would be undesirable, but likely survivable. Maybe it's better this way either way if the future sees others monkeying with the the session's connection for integration purposes.
For when there's an existing connection that is not controlled by session. This facilitates integration with other elements that are Postgres-based, and a single transaction has to be used to bound message writes and other extraneous, external Postgres operations.
Consider making the session's connection attribute read-only, and only allow injection from construction. But then the rest of the implementation would have to make use of the
@sessioninstance variable. That would be undesirable, but likely survivable. Maybe it's better this way either way if the future sees others monkeying with the the session's connection for integration purposes.