Aestate
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

 thread
 

Static Public Attributes

 version = __version__
 

Private Attributes

 _maxusage
 
 _setsession
 
 _closeable
 
 _kwargs
 

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 persistent_pg.py.

Constructor & Destructor Documentation

◆ __init__()

def aestate.opera.DBPool.persistent_pg.PersistentPg.__init__ (   self,
  maxusage = None,
  setsession = None,
  closeable = False,
  threadlocal = None,
args,
**  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 persistent_pg.py.

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 persistent_pg.py.

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 persistent_pg.py.

Here is the caller graph for this function:

Member Data Documentation

◆ _closeable

aestate.opera.DBPool.persistent_pg.PersistentPg._closeable
private

Definition at line 38 of file persistent_pg.py.

◆ _kwargs

aestate.opera.DBPool.persistent_pg.PersistentPg._kwargs
private

Definition at line 39 of file persistent_pg.py.

◆ _maxusage

aestate.opera.DBPool.persistent_pg.PersistentPg._maxusage
private

Definition at line 36 of file persistent_pg.py.

◆ _setsession

aestate.opera.DBPool.persistent_pg.PersistentPg._setsession
private

Definition at line 37 of file persistent_pg.py.

◆ thread

aestate.opera.DBPool.persistent_pg.PersistentPg.thread

Definition at line 40 of file persistent_pg.py.

◆ version

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

Definition at line 17 of file persistent_pg.py.


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