$86 GRAYBYTE WORDPRESS FILE MANAGER $71

SERVER : in-mum-web1330.main-hosting.eu #1 SMP Mon Feb 10 22:45:17 UTC 2025
SERVER IP : 147.79.69.129 | ADMIN IP 216.73.216.143
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/python37/share/doc/alt-python37-alembic/docs/build/api/

HOME
Current File : /opt/alt/python37/share/doc/alt-python37-alembic/docs/build/api//commands.rst
.. _alembic.command.toplevel:

=========
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.

Commands can be run programmatically, by first constructing a :class:`.Config`
object, as in::

    from alembic.config import Config
    from alembic import command
    alembic_cfg = Config("/path/to/yourapp/alembic.ini")
    command.upgrade(alembic_cfg, "head")

In many cases, and perhaps more often than not, an application will wish
to call upon a series of Alembic commands and/or other features.  It is
usually a good idea to link multiple commands along a single connection
and transaction, if feasible.  This can be achieved using the
:attr:`.Config.attributes` dictionary in order to share a connection::

    with engine.begin() as connection:
        alembic_cfg.attributes['connection'] = connection
        command.upgrade(alembic_cfg, "head")

This recipe requires that ``env.py`` consumes this connection argument;
see the example in :ref:`connection_sharing` for details.

To write small API functions that make direct use of database and script directory
information, rather than just running one of the built-in commands,
use the :class:`.ScriptDirectory` and :class:`.MigrationContext`
classes directly.

.. automodule:: alembic.command
    :members:

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
25 Jan 2024 4.26 PM
root / 996
0755
api_overview.png
121.06 KB
16 Oct 2015 7.18 PM
root / 996
0644
autogenerate.rst
24.643 KB
16 Oct 2015 7.18 PM
root / 996
0644
commands.rst
1.681 KB
16 Oct 2015 7.18 PM
root / 996
0644
config.rst
1.202 KB
16 Oct 2015 7.18 PM
root / 996
0644
ddl.rst
1.064 KB
16 Oct 2015 7.18 PM
root / 996
0644
index.rst
0.989 KB
16 Oct 2015 7.18 PM
root / 996
0644
operations.rst
6.609 KB
16 Oct 2015 7.18 PM
root / 996
0644
overview.rst
3.329 KB
16 Oct 2015 7.18 PM
root / 996
0644
runtime.rst
1.372 KB
16 Oct 2015 7.18 PM
root / 996
0644
script.rst
0.439 KB
16 Oct 2015 7.18 PM
root / 996
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF