If the :meth:`.is_offline_mode` function returns ``True``,
then no connection is needed here. Otherwise, the
``connection`` parameter should be present as an
- instance of :class:`sqlalchemy.engine.
+ instance of :class:`sqlalchemy.engine.Connection`.
This function is typically called from the ``env.py``
script within a migration environment. It can be called
multiple times for an invocation. The most recent
for which it was called is the one that will be operated upon
by the next call to :meth:`.run_migrations`.
- :param connection: a :class:`~sqlalchemy.engine.
+ :param connection: a :class:`~sqlalchemy.engine.Connection`
for SQL execution in "online" mode. When present, is also
used to determine the type of dialect in use.
will be consulted during autogeneration. The tables present
what is locally available on the target
to produce candidate upgrade/downgrade operations.
:param compare_type: Indicates type comparison behavior during
the output stream, as rendered by the
target backend (e.g. SQL Server would
emit ``BEGIN TRANSACTION``).
- * Otherwise, calls :meth:`sqlalchemy.engine.
+ * Otherwise, calls :meth:`sqlalchemy.engine.Connection.begin`
on the current online connection, which
- returns a :class:`sqlalchemy.engine.
+ returns a :class:`sqlalchemy.engine.Transaction`
object. This object demarcates a real
transaction and is itself a context manager,
which will roll back if an exception
Note that a custom ``env.py`` script which
has more specific transactional needs can of course
- manipulate the :class:`~sqlalchemy.engine.
+ manipulate the :class:`~sqlalchemy.engine.Connection`
directly to produce transactional state in "online"
"""Return the current 'bind'.
In "online" mode, this is the
base.Connection` currently being used
+ :class:`sqlalchemy.engine.Connection` currently being used
to emit SQL to the database.
This function requires that a :class:`.MigrationContext`