Package Modeling :: Package DatabaseAdaptors :: Package SQLiteAdaptorLayer :: Module SQLiteAdaptor :: Class SQLiteAdaptor
[show private | hide private]
[frames | no frames]

Class SQLiteAdaptor

          Adaptor --+    
                    |    
AbstractDBAPI2Adaptor --+
                        |
                       SQLiteAdaptor


Concrete AdaptorContext for SQLite [module psycopg or pgdb]
Method Summary
  createAdaptorContext(self)
See Modeling.interfaces.Adaptor for details
  createDatabaseWithAdministrativeConnectionDictionary(self, administrativeConnectionDictionary, createUserFlag)
Overrides AbstractDBAPI2Adaptor's method and does nothing except opening a connection to the new database, which is enough to create a database with sqlite
  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 Modeling.SQLExpression.SQLExpression
  dropDatabaseWithAdministrativeConnectionDictionary(self, administrativeConnectionDictionary, dropUserFlag)
Overrides AbstractDBAPI2Adaptor's method and os.unlink() the database file.
  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
  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

createDatabaseWithAdministrativeConnectionDictionary(self, administrativeConnectionDictionary, createUserFlag=0)

Overrides AbstractDBAPI2Adaptor's method and does nothing except opening a connection to the new database, which is enough to create a database with sqlite
Overrides:
Modeling.DatabaseAdaptors.AbstractDBAPI2AdaptorLayer.AbstractDBAPI2Adaptor.AbstractDBAPI2Adaptor.createDatabaseWithAdministrativeConnectionDictionary

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 Modeling.SQLExpression.SQLExpression
Overrides:
Modeling.DatabaseAdaptors.AbstractDBAPI2AdaptorLayer.AbstractDBAPI2Adaptor.AbstractDBAPI2Adaptor.defaultExpressionClass

dropDatabaseWithAdministrativeConnectionDictionary(self, administrativeConnectionDictionary, dropUserFlag=0)

Overrides AbstractDBAPI2Adaptor's method and os.unlink() the database file. Parameter administrativeConnectionDictionary cannot be omitted here, even if there's no such connection dictionary for sqlite: the database to be removed is extracted from the dictionary's 'database' key (this is also to prevent the accidental destruction of valuable data).

Unlike other adaptors, this method does NOT call SQLiteSchemaGeneration.dropDatabaseStatementsForConnectionDictionary()

Overrides:
Modeling.DatabaseAdaptors.AbstractDBAPI2AdaptorLayer.AbstractDBAPI2Adaptor.AbstractDBAPI2Adaptor.dropDatabaseWithAdministrativeConnectionDictionary

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:20 2006 http://epydoc.sf.net