Package gnue :: Package common :: Package datasources :: Package drivers :: Package sql :: Package sqlite3 :: Module Behavior :: Class Behavior
[show private | hide private]

Class Behavior

Behavior --+        
           |        
    Behavior --+    
               |    
        Behavior --+
                   |
                  Behavior


Behavior class for SQLite3 backends.

Limitations:
Method Summary
  __init__(self, connection)
Create a new Behavior instance.
    Inherited from Behavior
  _createConstraint_(self, constraint)
SQLite does not support referential constraints, so this function returns an empty code-triple.
  _createDatabase_(self)
Create a new SQLite database for the associated connection.
  _createPrimaryKey_(self, pkey)
Create a code-triple for the given primary key
  _createTable_(self, table)
Generate a code-triple to create or change the given table.
  _dropConstraint_(self, constraint)
SQLite does not support referential constraints, so this function returns an empty code-triple.
  _readSchema_(self, parent)
Read the connection's schema and build a GSchema object tree connected to the given parent object (which is of type GSSchema).
    Inherited from Behavior
  _create_table_trailer_(self, table)
Create trailing SQL code for building a table.
  _createFields_(self, item)
Create a code-triple for the given GSTable or GSField.
  _createIndex_(self, index)
Create a code triple for the given index.
  _defaultwith_(self, code, field)
Process special kinds of default values like sequences, functions and so on.
  _dropIndex_(self, index)
Create a command sequence for dropping the given index.
  _integrateNullable_(self, code, field)
Handle the nullable-flag of a given field.
  _processField_(self, field)
Create a code-triple for a single field.
  _setColumnDefault_(self, code, field, default)
Set a default value for a given column.
  _writeSchema_(self, current, new, diff, simulation)
Integrate the given schema into the current connection's schema and return the commands used to achive this.
  number(self, field)
Return the native datatye for a numeric field.
  string(self, field)
Return the native datatype for a string field.
    Inherited from Behavior
  __repr__(self)
  createDatabase(self)
Create a new database specified by the associated connection.
  readSchema(self)
Retrieve the connection's schema information and return it as GSchema object tree.
  writeSchema(self, schema, simulation)
Generate a command sequence to integrate the given schema tree into the connection's current schema.

Class Variable Summary
    Inherited from Behavior
bool _alterMultiple_: boolean flag indicating wether an 'alter table' statement can contain multiple fields or not.
bool _extraPrimaryKey_: boolean flag indicating wether primary keys must be added with an extra command (ie.
tuple _numbers_: triple specifying rules for datatype transformation of numeric types.
dict _type2native_: dictionary mapping field-types to native datatypes.
list _writeableTypes_: list of GSTables-types to be handled by writeSchema ().
    Inherited from Behavior
NoneType _maxIdLength_: maximum length of an identifier or None if no restriction.

Method Details

__init__(self, connection)
(Constructor)

Create a new Behavior instance.

This is usually done silently when creating a connection instance.
Parameters:
connection - The Connection.Connection instance bound to this Behavior instance.
Overrides:
gnue.common.datasources.drivers.sql.sqlite2.Behavior.Behavior.__init__ (inherited documentation)


GNUe Home

Public API

Developer's Corner