l.s.w.p.PGSessionDataContainer(PGSessionBase) : class documentation

Part of lp.services.webapp.pgsession View In Hierarchy

An ISessionDataContainer that stores data in PostgreSQL

PostgreSQL Schema:

CREATE TABLE SessionData (
    client_id     text PRIMARY KEY,
    last_accessed timestamp with time zone
        NOT NULL DEFAULT CURRENT_TIMESTAMP
    );
CREATE INDEX sessiondata_last_accessed_idx ON SessionData(last_accessed);
CREATE TABLE SessionPkgData (
    client_id  text NOT NULL
        REFERENCES SessionData(client_id) ON DELETE CASCADE,
    product_id text NOT NULL,
    key        text NOT NULL,
    pickle     bytea NOT NULL,
    CONSTRAINT sessiondata_key UNIQUE (client_id, product_id, key)
    );

Removing expired data needs to be done out of band.
Method __getitem__ See zope.session.interfaces.ISessionDataContainer
Method __setitem__ See zope.session.interfaces.ISessionDataContainer

Inherited from PGSessionBase:

Method store Undocumented
def __getitem__(self, client_id):
See zope.session.interfaces.ISessionDataContainer
def __setitem__(self, client_id, session_data):
See zope.session.interfaces.ISessionDataContainer
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.