Package gavo :: Package base :: Module sqlsupport :: Class QuerierMixin
[frames] | no frames]

Class QuerierMixin

source code

        object --+    
                 |    
PostgresQueryMixin --+
                     |
        object --+   |
                 |   |
StandardQueryMixin --+
                     |
                    QuerierMixin
Known Subclasses:

is a mixin for "queriers", i.e., objects that maintain a db connection.

The mixin assumes an attribute connection from the parent.

Instance Methods
 
configureConnection(self, settings) source code
 
enableAutocommit(self) source code
 
query(self, query, data={}, timeout=None)
wraps conn.query adding logic to re-establish lost connections.
source code
 
queryToDicts(self, *args, **kwargs)
wraps conn.queryToDicts for backwards compatilitiy.
source code
 
queryDicts(self, *args, **kwargs)
wraps conn.queryToDicts for backwards compatilitiy.
source code
 
finish(self) source code
 
abort(self) source code

Inherited from PostgresQueryMixin: dropTable, foreignKeyExists, getACLFromRes, getColumnsFromDB, getForeignKeyName, getOIDForTable, getPrimaryIndexName, getRowEstimate, getSchemaPrivileges, getServerVersion, getTablePrivileges, getTableType, hasIndex, parsePGACL, roleExists, schemaExists

Inherited from StandardQueryMixin: getTimeout, setSchemaPrivileges, setTablePrivileges, setTimeout

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

Class Variables
  defaultProfile = None
hash(x)
Properties

Inherited from object: __class__

Method Details

query(self, query, data={}, timeout=None)

source code 

wraps conn.query adding logic to re-establish lost connections.

Don't use this method any more in new code. It contains wicked logic to tell DDL statements (that run without anyone pulling the results) from actual selects. That's a bad API. Also note that the timeout is ignored for DDL statements.

Use either connection.query or connection.execute in new code.