Package trac :: Package db :: Module util :: Class ConnectionWrapper

Class ConnectionWrapper

source code

object --+
         |
        ConnectionWrapper
Known Subclasses:

Generic wrapper around connection objects.
Instance Methods
 
__call__(self, query, params=None)
Execute an SQL query
source code
 
__getattr__(self, name) source code
 
__init__(self, cnx, log=None, readonly=False)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
check_select(self, query)
Verify if the query is compatible according to the readonly nature of the wrapped Connection.
source code
 
execute(self, query, params=None)
Execute an SQL query
source code
 
executemany(self, query, params=None)
Execute an SQL query, on a sequence of tuples ("executemany").
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  cnx
  log
  readonly

Inherited from object: __class__

Method Details

__call__(self, query, params=None)
(Call operator)

source code 

Execute an SQL query

The optional params is a tuple containing the parameter values expected by the query.

If the query is a SELECT, return all the rows ("fetchall"). When more control is needed, use cursor().

__init__(self, cnx, log=None, readonly=False)
(Constructor)

source code 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

check_select(self, query)

source code 
Verify if the query is compatible according to the readonly nature of the wrapped Connection.
Returns:
True if this is a SELECT

execute(self, query, params=None)

source code 

Execute an SQL query

The optional params is a tuple containing the parameter values expected by the query.

If the query is a SELECT, return all the rows ("fetchall"). When more control is needed, use cursor().

executemany(self, query, params=None)

source code 

Execute an SQL query, on a sequence of tuples ("executemany").

The optional params is a sequence of tuples containing the parameter values expected by the query.

If the query is a SELECT, return all the rows ("fetchall"). When more control is needed, use cursor().