Package pydo :: Module dbi
[show private | hide private]
[frames | no frames]

Module pydo.dbi

Classes
ConnectionPool a connection pool for a single connection alias.
ConnectionWrapper a connection object returned from a connection pool which wraps a real db connection.
DBIBase base class for db connection wrappers.

Function Summary
  delAlias(alias)
delete a connection alias if it has already been initialized; does nothing otherwise
  getConnection(alias, create)
get a connection given a connection alias
  initAlias(alias, driver, connectArgs, pool, verbose, init)
initializes a connection alias with the stated connection arguments.
  _connect(driver, connectArgs, pool, verbose, initFunc)
  _get_driver_class(name)
  _real_connect(connfunc, connargs, initFunc)

Variable Summary
dict _aliases = {}
lock _connlock = <thread.lock object at 0xb7c3a0e0>
dict _driverConfig = {'oracle': 'pydo.drivers.oracleconn.Orac...
dict _loadedDrivers = {}
tuple exception_names = ('DataError', 'DatabaseError', 'Error'...

Function Details

delAlias(alias)

delete a connection alias if it has already been initialized; does nothing otherwise

getConnection(alias, create=True)

get a connection given a connection alias

initAlias(alias, driver, connectArgs, pool=None, verbose=False, init=None)

initializes a connection alias with the stated connection arguments.

It can cause confusion to let this be called repeatedly; you might think you are initializing it one way and not realize it is being initialized elsewhere differently. Therefore, this raises a ValueError if the alias is already initialized with different data. Multiple initializations with the same data (such as happens when a module calling initAlias is reloaded) are permitted.

If you need to change the connect values at runtime, call delAlias before initAlias.

Variable Details

_aliases

Type:
dict
Value:
{}                                                                     

_connlock

Type:
lock
Value:
<thread.lock object at 0xb7c3a0e0>                                     

_driverConfig

Type:
dict
Value:
{'mssql': 'pydo.drivers.mssqlconn.MssqlDBI',
 'mysql': 'pydo.drivers.mysqlconn.MysqlDBI',
 'oracle': 'pydo.drivers.oracleconn.OracleDBI',
 'psycopg': 'pydo.drivers.psycopgconn.PsycopgDBI',
 'sqlite': 'pydo.drivers.sqliteconn.SqliteDBI'}                        

_loadedDrivers

Type:
dict
Value:
{}                                                                     

exception_names

Type:
tuple
Value:
('DataError',
 'DatabaseError',
 'Error',
 'IntegrityError',
 'InterfaceError',
 'InternalError',
 'NotSupportedError',
 'OperationalError',
...                                                                    

Generated by Epydoc 2.0 on Wed Mar 8 10:18:59 2006 http://epydoc.sf.net