Package Modeling :: Package DatabaseAdaptors :: Package PostgresqlAdaptorLayer :: Module PostgresqlAdaptor
[show private | hide private]
[frames | no frames]

Module Modeling.DatabaseAdaptors.PostgresqlAdaptorLayer.PostgresqlAdaptor

PostgresqlAdaptor

The PostgresqlAdaptorLayer operates with either 'psycopg', 'pgdb' or 'PyPgSQL'. You can set the environment variable 'MDL_PREFERRED_PYTHON_POSTGRESQL_ADAPTOR' to either 'psycopg', 'pgdb' or 'pypgsql' to indicate your preference ; if this ennvironment variable is unset, or has an illegal value, the modules are searched one after the other until one is found (see also: initPythonAdaptorModule() for details).

CVS information

$Id: PostgresqlAdaptor.py,v 1.7 2004/08/02 19:58:54 sbigaret Exp $

Classes
PostgresqlAdaptor Concrete AdaptorContext for Postgresql [module psycopg or pgdb]

Function Summary
  initPythonAdaptorModule(preferred_module_name)
Initializes the module, by searching an available python-adaptor conforming to the DB API 2.0.
  pgdb_module()
Returns the 'pgdb' module, or None if it cannot be found
  psycopg_module()
Returns the 'psycopg' module, or None if it cannot be found
  pypgsql_module()
Returns the 'pyPgSQL.PgSQL' module, or None if it cannot be found

Function Details

initPythonAdaptorModule(preferred_module_name='')

Initializes the module, by searching an available python-adaptor conforming to the DB API 2.0. It currently searches for the following modules:

  1. 'psycopg'
  2. 'pgdb'
  3. 'PyPgSQL.PySQL'

and uses the first one it finds, except if 'preferred_module_name' is supplied --see details below.

Parameter:

preferred_module_name -- (optional) if supplied, the corresponding module
is tried before the others. Possible module's names are: 'psycopg', 'pgdb' or 'pypgsql' ; any other value is ignored and makes the function falls back to its default behaviour.

pgdb_module()

Returns the 'pgdb' module, or None if it cannot be found

psycopg_module()

Returns the 'psycopg' module, or None if it cannot be found

pypgsql_module()

Returns the 'pyPgSQL.PgSQL' module, or None if it cannot be found

Generated by Epydoc 2.1 on Sat Mar 4 13:36:23 2006 http://epydoc.sf.net