This module extends SQLAlchemy and provides additional DDL [1] support.
[1] | SQL Data Definition Language |
Extensions to SQLAlchemy for altering existing tables.
At the moment, this isn’t so much based off of ANSI as much as things that just happen to work with multiple databases.
Extends ANSI SQL dropper for column dropping (ALTER TABLE DROP COLUMN).
Drop a column from its table.
Parameter: | column (sqlalchemy.Column) – the column object |
---|
Extends ansisql generator for column creation (alter table add col)
Create a column (table already exists).
Parameter: | column (sqlalchemy.Column) – column object |
---|
Default table visitor, does nothing.
Parameter: | table (sqlalchemy.Table) – table object |
---|
Migrate’s constraints require a separate creation function from SA’s: Migrate’s constraints are created independently of a table; SA’s are created at the same time as the table.
Gets a name for the given constraint.
If the name is already set it will be used otherwise the constraint’s autoname method is used.
Parameter: | cons (migrate.changeset.constraint.ConstraintChangeset) – constraint object |
---|
Extends ansisql generator for column creation (alter table add col)
Manages changes to existing schema elements.
Note that columns are schema elements; ALTER TABLE ADD COLUMN is in SchemaGenerator.
All items may be renamed. Columns can also have many of their properties - type, for example - changed.
Each function is passed a tuple, containing (object,name); where object is a type of object you’d expect for that function (ie. table for visit_table) and name is the object’s new name. NONE means the name is unchanged.
Common operations for ALTER TABLE statements.
Returns the start of an ALTER TABLE SQL-Statement.
Use the param object to determine the table name and use it for building the SQL statement.
Parameter: | param (sqlalchemy.Column, sqlalchemy.Index, sqlalchemy.schema.Constraint, sqlalchemy.Table, or string (table name)) – object to determine the table from |
---|
This module defines standalone schema constraint classes.
Base class for Constraint classes.
Raises: | NotImplementedError if this method is not overridden by a subclass |
---|
Automatically generate a name for the constraint instance.
Subclasses must implement this method.
Raises: | NotImplementedError if this method is not overridden by a subclass |
---|
Create the constraint in the database.
Parameter: | engine (sqlalchemy.engine.base.Engine) – the database engine to use. If this is None the instance’s engine will be used |
---|
Drop the constraint from the database.
Parameter: | engine (sqlalchemy.engine.base.Engine) – the database engine to use. If this is None the instance’s engine will be used |
---|
This module contains database dialect specific changeset implementations.
MySQL database specific implementations of changeset classes.
Oracle database specific implementations of changeset classes.
PostgreSQL database specific implementations of changeset classes.
Module for visitor class mapping.
Get the visitor implementation for the given dialect.
Finds the visitor implementation based on the dialect class and returns and instance initialized with the given name.
This module provides exception classes.
Schema module providing common schema operations.
Alter a column.
Parameters: column name, table name, an engine, and the properties of that column to change
Rename an index.
Takes an index name/object, a table name/object, and an engine. Engine and table aren’t required if an index object is given.
This package provides functionality to create and manage repositories of database schema changesets and to apply these changesets to databases.
Provide exception classes for migrate.versioning
Code to generate a Python model from a database or differences between a model and database.
Some of this is borrowed heavily from the AutoCode project at: http://code.google.com/p/sqlautocode/
Schema differencing support.
Differences of model against database.
Return differences of model against database.
Returns: | object which will evaluate to True if there are differences else False. |
---|
Return differences of model against another model.
Returns: | object which will evaluate to True if there are differences else False. |
---|