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

Class PostgresqlAdaptor

          Adaptor --+    
                    |    
AbstractDBAPI2Adaptor --+
                        |
                       PostgresqlAdaptor


Concrete AdaptorContext for Postgresql [module psycopg or pgdb]
Method Summary
  createAdaptorContext(self)
See Modeling.interfaces.Adaptor for details
  dbAPI_connectionDictionaryForConnect(self, aModelConnectionDictionary)
TBD: doc.
  dbAPI_gimmeCnxAndCursorForDBAdmin(self, administrativeConnectionDictionary)
Returns a connection object (opened using the administrativeConnectionDictionary) and a cursor adequate to perform adminstrative tasks on the database (i.e., mainly, adequate to create or drop databases).
  defaultExpressionClass(self)
Returns PostgresqlSQLExpression
  expressionFactory(self)
See Modeling.interfaces.Adaptor for details
  schemaGenerationFactory(self)
See Modeling.interfaces.Adaptor for details
  underlying_py_adaptor_module()
(Static method)
    Inherited from AbstractDBAPI2Adaptor
  assertConnectionDictionaryIsValid(self)
See Modeling.interfaces.Adaptor for details
  assignExternalInfoForAttribute(self, anAttribute)
See Modeling.interfaces.Adaptor for details
  assignExternalInfoForEntity(self, anEntity)
See Modeling.interfaces.Adaptor for details
  createDatabaseWithAdministrativeConnectionDictionary(self, administrativeConnectionDictionary, createUserFlag)
TBD...
  dropDatabaseWithAdministrativeConnectionDictionary(self, administrativeConnectionDictionary, dropUserFlag)
TBD...
  externalTypesWithModel(self, aModel)
See Modeling.interfaces.Adaptor for details
  fetchedValueForDataValue(self, value, anAttribute)
See Modeling.interfaces.Adaptor for details
  fetchedValueForDateValue(self, value, anAttribute)
See Modeling.interfaces.Adaptor for details
  fetchedValueForNumberValue(self, value, anAttribute)
See Modeling.interfaces.Adaptor for details
  fetchedValueForStringValue(self, value, anAttribute)
See Modeling.interfaces.Adaptor for details
  fetchedValueForValue(self, value, anAttribute)
See Modeling.interfaces.Adaptor for details
  internalTypeForExternalType(self, extType, aModel)
See Modeling.interfaces.Adaptor for details
  isValidQualifierType(self, typeName, aModel)
See Modeling.interfaces.Adaptor for details
    Inherited from Adaptor
  __init__(self, name)
See interfaces.Adaptor for details
  __unimplemented__(self)
  adaptorWithModel(aModel)
Returns the adaptor associated to the supplied model: it extracts the name of the adaptor to be used with the model then calls adaptorWithModel() Raises ValueError is parameter 'aModel' is None or if its adaptorName is empty. (Static method)
  adaptorWithName(aName)
Returns the adaptor. (Static method)
  administrativeConnectionDictionaryForAdaptor(self, anAdaptor)
See interfaces.Adaptor for details
  assignExternalInfoForEntireModel(self, aModel)
See interfaces.Adaptor for details
  assignExternalTypeForAttribute(self, anAttribute)
See interfaces.Adaptor for details
  canServiceModel(self, aModel)
Compares 'aModel' 's connectionDictionary with self's and returns the result
  connectionDictionary(self)
Returns the connectionDictionary
  contexts(self)
Returns all AdaptorContexts created and registered with this Adaptor
  defaultDelegate()
Returns the default delegate. (Static method)
  delegate(self)
Returns the delegate for that Adaptor ; when initialized the delegate is the one returned by defaultDelegate()
  expressionClass(self)
Returns the expression class to be used with the Adaptor.
  expressionClassForAdaptor(adaptor)
Returns the expression class to be used by adaptor, or None if none was previously set with 'setExpressionClassForAdaptor()'. (Static method)
  handleDroppedConnection(self)
Unimplemented yet
  hasOpenChannels(self)
Forwards the messages to all contexts() and returns 1 (true value) if at least one of these returned a true value, return 0 (false value) otherwise.
  isDroppedConnectionException(self, exception)
See interfaces.Adaptor for details
  name(self)
Returns the name that was used when the concrete Adaptor was instanciated.
  prototypeAttributes(self)
See interfaces.Adaptor for details
  setConnectionDictionary(self, connectionDictionary)
Sets the connectionDictionary.
  setDefaultDelegate(delegate)
Sets the default delegate which is assigned to Adaptor instances when they are initialized. (Static method)
  setDelegate(self, aDelegate)
Sets the delegate (not used yet)
  setExpressionClassForAdaptor(sqlExpression, adaptor)
Sets the SQLExpression to use in conjonction with a particular adaptor. (Static method)

Class Variable Summary
    Inherited from AbstractDBAPI2Adaptor
tuple __implements__ = (<class Modeling.interfaces.Adaptor.IAd...
    Inherited from Adaptor
str __raise_exception__ = 'AbstractMethod'
str __raise_msg__ = 'Left intentionally unimplemented in thi...

Instance Method Details

createAdaptorContext(self)

See Modeling.interfaces.Adaptor for details
Overrides:
Modeling.DatabaseAdaptors.AbstractDBAPI2AdaptorLayer.AbstractDBAPI2Adaptor.AbstractDBAPI2Adaptor.createAdaptorContext

dbAPI_connectionDictionaryForConnect(self, aModelConnectionDictionary)

TBD: doc.
Overrides:
Modeling.DatabaseAdaptors.AbstractDBAPI2AdaptorLayer.AbstractDBAPI2Adaptor.AbstractDBAPI2Adaptor.dbAPI_connectionDictionaryForConnect

dbAPI_gimmeCnxAndCursorForDBAdmin(self, administrativeConnectionDictionary)

Returns a connection object (opened using the administrativeConnectionDictionary) and a cursor adequate to perform adminstrative tasks on the database (i.e., mainly, adequate to create or drop databases).

Note that depending on the underlying adaptor and the corresponding database, this can be more or less easy to provide. For example, Postgresql db does not allow any SQL statement like 'CREATE DATABASE' to be executed while a transaction is opened. Since the python DB-API implicitly requires that a transaction is automatically opened, a simple connect is not sufficient. To continue with postgresql, the python module 'psycopg' offers an 'autocommit()' method on connection to toggle the automatic opening of a transaction, while the 'pgdb' module requires some additional work with its underlying '_pg' module.

Subclasses should override this method without calling the superclass' implementation.

Parameter:

administrativeConnectionDictionary -- a dictionary made of the following
keys: 'host', 'database', 'user' and 'password' (see also: Modeling.Model.connectionDictionary()).
Overrides:
Modeling.DatabaseAdaptors.AbstractDBAPI2AdaptorLayer.AbstractDBAPI2Adaptor.AbstractDBAPI2Adaptor.dbAPI_gimmeCnxAndCursorForDBAdmin (inherited documentation)

defaultExpressionClass(self)

Returns PostgresqlSQLExpression
Overrides:
Modeling.DatabaseAdaptors.AbstractDBAPI2AdaptorLayer.AbstractDBAPI2Adaptor.AbstractDBAPI2Adaptor.defaultExpressionClass

expressionFactory(self)

See Modeling.interfaces.Adaptor for details
Overrides:
Modeling.DatabaseAdaptors.AbstractDBAPI2AdaptorLayer.AbstractDBAPI2Adaptor.AbstractDBAPI2Adaptor.expressionFactory

schemaGenerationFactory(self)

See Modeling.interfaces.Adaptor for details
Overrides:
Modeling.DatabaseAdaptors.AbstractDBAPI2AdaptorLayer.AbstractDBAPI2Adaptor.AbstractDBAPI2Adaptor.schemaGenerationFactory

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