Autogeneration
==============
+.. note:: this section discusses the **internal API of Alembic**
+ as regards the autogeneration feature of the ``alembic revision``
+ command.
+ This section is only useful for developers who wish to extend the
+ capabilities of Alembic. For general documentation on the autogenerate
+ feature, please see :doc:`/autogenerate`.
+
The autogeneration system has a wide degree of public API, including
the following areas:
Commands
=========
+.. note:: this section discusses the **internal API of Alembic**
+ as regards its command invocation system.
+ This section is only useful for developers who wish to extend the
+ capabilities of Alembic. For documentation on using Alembic commands,
+ please see :doc:`/tutorial`.
+
Alembic commands are all represented by functions in the :ref:`alembic.command.toplevel`
package. They all accept the same style of usage, being sent
the :class:`.Config` object as the first argument.
Configuration
==============
+.. note:: this section discusses the **internal API of Alembic** as
+ regards internal configuration constructs.
+ This section is only useful for developers who wish to extend the
+ capabilities of Alembic. For documentation on configuration of
+ an Alembic environment, please see :doc:`/tutorial`.
+
The :class:`.Config` object represents the configuration
passed to the Alembic environment. From an API usage perspective,
it is needed for the following use cases:
:maxdepth: 2
overview
- environment
- migration
+ runtime
config
commands
operations
+++ /dev/null
-.. _alembic.runtime.migration.toplevel:
-
-=====================
-The Migration Context
-=====================
-
-.. automodule:: alembic.runtime.migration
- :members: MigrationContext
Operation Directives
=====================
+.. note:: this section discusses the **internal API of Alembic** as regards
+ the internal system of defining migration operation directives.
+ This section is only useful for developers who wish to extend the
+ capabilities of Alembic. For end-user guidance on Alembic migration
+ operations, please see :ref:`ops`.
+
Within migration scripts, actual database migration operations are handled
via an instance of :class:`.Operations`. The :class:`.Operations` class
lists out available migration operations that are linked to a
Overview
========
+.. note:: this section is a technical overview of the
+ **internal API of Alembic**.
+ This section is only useful for developers who wish to extend the
+ capabilities of Alembic; for regular users, reading this section
+ is **not necessary**.
+
A visualization of the primary features of Alembic's internals is presented
in the following figure. The module and class boxes do not list out
all the operations provided by each unit; only a small set of representative
.. _alembic.runtime.environment.toplevel:
=======================
+Runtime Objects
+=======================
+
+The "runtime" of Alembic involves the :class:`.EnvironmentContext`
+and :class:`.MigrationContext` objects. These are the objects that are
+in play once the ``env.py`` script is loaded up by a command and
+a migration operation proceeds.
+
The Environment Context
=======================
.. automodule:: alembic.runtime.environment
:members: EnvironmentContext
+
+.. _alembic.runtime.migration.toplevel:
+
+The Migration Context
+=====================
+
+The :class:`.MigrationContext` handles the actual work to be performed
+against a database backend as migration operations proceed. It is generally
+not exposed to the end-user.
+
+.. automodule:: alembic.runtime.migration
+ :members: MigrationContext