Home | Trees | Index | Help |
|
---|
Package Modeling :: Package DatabaseAdaptors :: Package MySQLAdaptorLayer :: Module MySQLSchemaGeneration :: Class MySQLSchemaGeneration |
|
SchemaGeneration
--+
|
MySQLSchemaGeneration
Implements the details db-schema generation which differ from the standard behaviour implemented by SchemaGeneration.
See also Modeling.SchemaGeneration and Modeling.interfaces.SchemaGeneration for further details
Method Summary | |
---|---|
See also: interfaces.SchemaGeneration for details | |
See Modeling.interfaces.SchemaGeneration for details | |
Returns a list containing a single SQLExpression statement, which takes the following form: 'DROP TABLE <SEQUENCE_NAME>', where '<SEQUENCE_NAME>' is: | |
Removes ' INITIALLY DEFERRED' from the statements returned by SQLExpression's foreignKeyConstraintStatementsForRelationship() and returns them. | |
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. | |
Returns a list of SQLExpressions needed to create the tables defined by the supplied 'entityGroup', or an empty list if 'entityGroup' is 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) | |
Default implementation returns an empty list. | |
Default implementation returns an empty list. | |
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. | |
Default implementation returns an empty list. | |
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)See also: interfaces.SchemaGeneration for details |
dropDatabaseStatementsForConnectionDictionary(self, connectionDictionary, administrativeConnectionDictionary, dropUserFlag=0)See Modeling.interfaces.SchemaGeneration for details |
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 MySQL databases. See Modeling.interfaces.SchemaGeneration for further details |
foreignKeyConstraintStatementsForRelationship(self, relationship)Removes ' INITIALLY DEFERRED' from the statements returned by SQLExpression's foreignKeyConstraintStatementsForRelationship() and returns them. |
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() cf. http://www.mysql.com/doc/en/Miscellaneous_functions.html: this is one way to emulate real sequences with MySQL. The statements used by MySQLAdaptorChannel.primaryKeysForNewRowsWithEntity are the following: 'UPDATE PK_SEQ_%s SET id=LAST_INSERT_ID(id+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 |