Public Member Functions | Public Attributes | Static Public Attributes | Private Attributes | List of all members
aestate.opera.DBPool.persistent_pg.PersistentPg Class Reference
Collaboration diagram for aestate.opera.DBPool.persistent_pg.PersistentPg:
Collaboration graph

Public Member Functions

def __init__ (self, maxusage=None, setsession=None, closeable=False, threadlocal=None, *args, **kwargs)
def steady_connection (self)
def connection (self)

Public Attributes


Static Public Attributes

 version = __version__

Private Attributes


Detailed Description

Generator for persistent classic PyGreSQL connections.

After you have created the connection pool, you can use
connection() to get thread-affine, steady PostgreSQL connections.

Definition at line 10 of file

Constructor & Destructor Documentation

◆ __init__()

def aestate.opera.DBPool.persistent_pg.PersistentPg.__init__ (   self,
  maxusage = None,
  setsession = None,
  closeable = False,
  threadlocal = None,
**  kwargs 
Set up the persistent PostgreSQL connection generator.

maxusage: maximum number of reuses of a single connection
    (0 or None means unlimited reuse)
    When this maximum usage number of the connection is reached,
    the connection is automatically reset (closed and reopened).
setsession: optional list of SQL commands that may serve to prepare
    the session, e.g. ["set datestyle to ...", "set time zone ..."]
closeable: if this is set to true, then closing connections will
    be allowed, but by default this will be silently ignored
threadlocal: an optional class for representing thread-local data
    that will be used instead of our Python implementation
    (threading.local is faster, but cannot be used in all cases)
args, kwargs: the parameters that shall be used to establish
    the PostgreSQL connections using class PyGreSQL pg.DB()

Definition at line 19 of file

Member Function Documentation

◆ connection()

def aestate.opera.DBPool.persistent_pg.PersistentPg.connection (   self)
Get a steady, persistent PyGreSQL connection.

Definition at line 50 of file

Here is the call graph for this function:
Here is the caller graph for this function:

◆ steady_connection()

def aestate.opera.DBPool.persistent_pg.PersistentPg.steady_connection (   self)
Get a steady, non-persistent PyGreSQL connection.

Definition at line 44 of file

Here is the caller graph for this function:

Member Data Documentation

◆ _closeable


Definition at line 38 of file

◆ _kwargs


Definition at line 39 of file

◆ _maxusage


Definition at line 36 of file

◆ _setsession


Definition at line 37 of file

◆ thread


Definition at line 40 of file

◆ version

aestate.opera.DBPool.persistent_pg.PersistentPg.version = __version__

Definition at line 17 of file

The documentation for this class was generated from the following file: