Wrapper for connection objects which retain access to driver
||DB-driver-aware connection-object wrapper|
The primary purpose of the wrapper here is to retain
a link to the driver object which created the connection.
The connection otherwise defers to the underlying
DB-API connection object.
The secondary purpose of the connection is to override
the cursor method to return a dbcursor.DBCursor instance
rather than a raw DB-API cursor object. You can customize
the class of the cursor object by setting the
defaultCursorClass property of the connection.
- Method resolution order:
Methods defined here:
- __getattr__(self, key)
- Defer to the connection for attribute lookup
- Open and return a new DBCursor instance for this connection
Normally the returned cursor will be an instance of the
pytable.dbcursor.DBCursor class, this can be overridden
by setting the defaultCursorClass property of the
- Reconnect an invalid connection using it's specifier
- Mark ourselves invalid and pass call to our base connection
Data and other attributes defined here:
- connection = <BasicProperty 'connection'>
- Pointer to the underlying DB-API connection
- defaultCursorClass = <ClassProperty 'defaultCursorClass'>
- DBCursor sub-class to be used for this connection
The class' constructor should have a signature similar to
classObject( cursor = <cursor>, connection = <conn> )
which will be called with named arguments.
- driver = <BasicProperty 'driver'>
- Pointer to the DBDriver instance which created this connection
- invalid = <BooleanProperty 'invalid'>
- The connection has become invalid, normally as a result of an OperationalError, reconnect!
- specifier = <BasicProperty 'specifier'>
- Pointer to the specifier used to connect
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data and other attributes inherited from Propertied:
- __dict__ = <dictproxy object at 0x01DF3890>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Propertied' objects>
- list of weak references to the object (if defined)