class PostgresSessionStore(SessionStore):
Constructor: PostgresSessionStore(conn, table)
Store pickled sessions in an SQL database.
See the create() function for the table definition.
This implementation has been tested with psycopg. It should work with any DB-API module that supports connection.rollback() and "%(var)s" substitution style, e.g. psycopg.
Method | __init__ |
__init__ takes a psycopg connection to a PostgreSQL database, together with an optional table name, 'table'. |
Method | delete |
Delete session from the database. |
Method | load |
Load a pickled session from the database. |
Method | save |
Pickle session & save it into the database. |
Method | setup |
Initialize the session store; e.g., create required database tables. If a previous store exists, overwrite it or raise an error. The default implmenetation does nothing, meaning no setup is necessary. |
Class Variable | is |
Undocumented |
Class Variable | is |
Undocumented |
Instance Variable | conn |
Undocumented |
Instance Variable | table |
Undocumented |
Inherited from SessionStore
:
Method | delete |
Delete all sessions that have not been modified for N minutes. The default implementation does nothing, meaning the store cannot delete old sessions. |
Method | has |
Return true if the session exists in the store, else false. |
Method | iter |
Return an iterable of (id, session) for all sessions in the store. |
__init__ takes a psycopg connection to a PostgreSQL database, together with an optional table name, 'table'.
Initialize the session store; e.g., create required database tables. If a previous store exists, overwrite it or raise an error. The default implmenetation does nothing, meaning no setup is necessary.
This method is never called by the session manager; it's for your application setup program.