Home | Trees | Index | Help |
|
---|
Package Modeling :: Package DatabaseAdaptors :: Package SQLiteAdaptorLayer :: Module SQLiteSchemaGeneration :: Class SQLiteSchemaGeneration |
|
SchemaGeneration
--+
|
SQLiteSchemaGeneration
Method Summary | |
---|---|
Returns an empty list: connecting to a non existent database is sufficient to create it. | |
Extends the default baheviour to add foreign key constraints in the CREATE TABLE sql statement. | |
Returns an empty list, since there's no way to drop a database within sqlite. | |
returns an empty list TBD | |
returns an empty list TBD | |
Returns a list containing a single SQLExpression statement, which takes the following form: 'DROP TABLE <SEQUENCE_NAME>', where '<SEQUENCE_NAME>' is: | |
Overrides the default behaviour so that constraints statements are not generated in a separate 'ALTER TABLE' statement (which is not supported by SQLite), but rather during the createTableStatementsForEntityGroup() phase. | |
Returns an empty list. | |
Returns a list containing two SQLExpression statements, which take the following form: | |
Inherited from SchemaGeneration | |
See interfaces.SchemaGeneration for details | |
Appends the expression to the StringIO script, prepended with a semi-colon (';') and a newline if the StringIO is not empty. | |
Invokes createTableStatementsForEntityGroup() for each entityGroup in 'entityGroups', and returns the list of SQLExpressions needed to create the necessary table. | |
Used in method SchemaGeneration.schemaCreationScriptForEntities() to order the schema creation statements produced (Static method) | |
Iterates on each entityGroup in 'entityGroups', sends the message 'dropPrimaryKeyConstraintStatementsForEntityGroup' to each of them, collects the results and returns them in a sequence. | |
Iterates on each entityGroup in 'entityGroups', sends the message 'dropPrimaryKeySupportStatementsForEntityGroup' to each of them, collects the results and returns them in a sequence. | |
Parameter: | |
Iterates on each entityGroup in 'entityGroups', sends the message 'dropPrimaryKeySupportStatementsForEntityGroup()' to each of them, collects the results and returns them in a sequence. | |
Iterates on each entityGroup in 'entityGroups', sends the message 'primaryKeyConstraintStatementsForEntityGroup' to each of them, collects the results and returns them in a sequence. | |
Iterates on each entityGroup in 'entityGroups', sends the message 'primaryKeySupportStatementsForEntityGroup' to each of them, collects the results and returns them in a sequence. | |
__TBD | |
__TBD doc. | |
__TBD doc. | |
Sets the default ordering. (Static method) | |
Returns a list of entityGroups ; each entityGroup consists of the entities in parameter 'entities' which share the same externalName(), and wich answered positively to the definesTableColumns() message. |
Class Variable Summary | |
---|---|
Inherited from SchemaGeneration | |
tuple |
__implements__ = (<class Modeling.interfaces.SchemaGener...
|
Instance Method Details |
---|
createDatabaseStatementsForConnectionDictionary(self, connectionDictionary, administrativeConnectionDictionary, createUserFlag=0)Returns an empty list: connecting to a non existent database is sufficient to create it. See also: interfaces.SchemaGeneration for details |
createTableStatementsForEntityGroup(self, entityGroup)Extends the default baheviour to add foreign key constraints in the CREATE TABLE sql statement. This is because SQLite does not support ALTER TABLE. It uses the overridden foreignKeyConstraintStatementsForRelationship() for that purpose, seee its docstring for details. Parameter: entityGroup -- a list of entities whose externalNames are identical. |
dropDatabaseStatementsForConnectionDictionary(self, connectionDictionary, administrativeConnectionDictionary, dropUserFlag=0)Returns an empty list, since there's no way to drop a database within sqlite. The only thing to do is to os.unlink() the database file. See also: SQLiteAdaptor.dropDatabaseWithAdministrativeConnectionDictionary See Modeling.interfaces.SchemaGeneration for details |
dropForeignKeyConstraintStatementsForRelationship(self, relationship)returns an empty list TBD |
dropPrimaryKeyConstraintStatementsForEntityGroup(self, entityGroup)returns an empty list TBD |
dropPrimaryKeySupportStatementsForEntityGroup(self, entityGroup)Returns a list containing a single SQLExpression statement, which takes the following form: 'DROP TABLE <SEQUENCE_NAME>', where '<SEQUENCE_NAME>' is: 'PK_SEQ_%s'%entityGroup[0].primaryKeyRootName() See primaryKeySupportStatementsForEntityGroup() for further details on how sequences can be emulated with SQLite databases. See Modeling.interfaces.SchemaGeneration for further details |
foreignKeyConstraintStatementsForRelationship(self, relationship, sqlExpr_for_create=None)Overrides the default behaviour so that constraints statements are not generated in a separate 'ALTER TABLE' statement (which is not supported by SQLite), but rather during the createTableStatementsForEntityGroup() phase. When 'sqlExpr_for_create' is supplied (see below), the following constraint is appended to its listString(): CONSTRAINT <REL_NAME> FOREIGN KEY (<FKS>) REFERENCES <DESTINATION_TABLE>(<DESTINATION_PK>)
The conditions under which the statement above is returned are:
If any of these conditions is not fulfilled the method returns an empty sequence. Parameters:
|
primaryKeyConstraintStatementsForEntityGroup(self, entityGroup)Returns an empty list. __TBD Parameter 'entityGroup' is a list of entities whose externalNames are identical.
|
primaryKeySupportStatementsForEntityGroup(self, entityGroup)Returns a list containing two SQLExpression statements, which take the following form: CREATE TABLE <SEQUENCE_NAME> (id INT NOT NULL) INSERT INTO <SEQUENCE_NAME> VALUES(0) where '<SEQUENCE_NAME>' is: 'PK_SEQ_%s'%entityGroup[0].primaryKeyRootName() The statements used by SQLiteAdaptorChannel.primaryKeysForNewRowsWithEntity are the following: 'UPDATE PK_SEQ_%s SET id=((select max(col1) from table1)+1'%pkRootName 'select id FROM PK_SEQ_%s'%pkRootName See Modeling.interfaces.SchemaGeneration for further details
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Sat Mar 4 13:36:25 2006 | http://epydoc.sf.net |