diff options
Diffstat (limited to 'alembic/context.pyi')
-rw-r--r-- | alembic/context.pyi | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/alembic/context.pyi b/alembic/context.pyi index a262638..a9f48b2 100644 --- a/alembic/context.pyi +++ b/alembic/context.pyi @@ -29,7 +29,7 @@ if TYPE_CHECKING: ### end imports ### def begin_transaction() -> Union[_ProxyTransaction, ContextManager[None]]: - r"""Return a context manager that will + """Return a context manager that will enclose an operation within a "transaction", as defined by the environment's offline and transactional DDL settings. @@ -107,7 +107,7 @@ def configure( on_version_apply: Optional[Callable[..., None]] = None, **kw: Any, ) -> None: - r"""Configure a :class:`.MigrationContext` within this + """Configure a :class:`.MigrationContext` within this :class:`.EnvironmentContext` which will provide database connectivity and other configuration to a series of migration scripts. @@ -543,7 +543,7 @@ def configure( def execute( sql: Union[ClauseElement, str], execution_options: Optional[dict] = None ) -> None: - r"""Execute the given SQL using the current change context. + """Execute the given SQL using the current change context. The behavior of :meth:`.execute` is the same as that of :meth:`.Operations.execute`. Please see that @@ -556,7 +556,7 @@ def execute( """ def get_bind() -> Connection: - r"""Return the current 'bind'. + """Return the current 'bind'. In "online" mode, this is the :class:`sqlalchemy.engine.Connection` currently being used @@ -568,7 +568,7 @@ def get_bind() -> Connection: """ def get_context() -> MigrationContext: - r"""Return the current :class:`.MigrationContext` object. + """Return the current :class:`.MigrationContext` object. If :meth:`.EnvironmentContext.configure` has not been called yet, raises an exception. @@ -576,7 +576,7 @@ def get_context() -> MigrationContext: """ def get_head_revision() -> Union[str, Tuple[str, ...], None]: - r"""Return the hex identifier of the 'head' script revision. + """Return the hex identifier of the 'head' script revision. If the script directory has multiple heads, this method raises a :class:`.CommandError`; @@ -590,7 +590,7 @@ def get_head_revision() -> Union[str, Tuple[str, ...], None]: """ def get_head_revisions() -> Union[str, Tuple[str, ...], None]: - r"""Return the hex identifier of the 'heads' script revision(s). + """Return the hex identifier of the 'heads' script revision(s). This returns a tuple containing the version number of all heads in the script directory. @@ -601,7 +601,7 @@ def get_head_revisions() -> Union[str, Tuple[str, ...], None]: """ def get_revision_argument() -> Union[str, Tuple[str, ...], None]: - r"""Get the 'destination' revision argument. + """Get the 'destination' revision argument. This is typically the argument passed to the ``upgrade`` or ``downgrade`` command. @@ -616,7 +616,7 @@ def get_revision_argument() -> Union[str, Tuple[str, ...], None]: """ def get_starting_revision_argument() -> Union[str, Tuple[str, ...], None]: - r"""Return the 'starting revision' argument, + """Return the 'starting revision' argument, if the revision was passed using ``start:end``. This is only meaningful in "offline" mode. @@ -629,7 +629,7 @@ def get_starting_revision_argument() -> Union[str, Tuple[str, ...], None]: """ def get_tag_argument() -> Optional[str]: - r"""Return the value passed for the ``--tag`` argument, if any. + """Return the value passed for the ``--tag`` argument, if any. The ``--tag`` argument is not used directly by Alembic, but is available for custom ``env.py`` configurations that @@ -655,7 +655,7 @@ def get_x_argument(as_dictionary: Literal[True]) -> Dict[str, str]: ... def get_x_argument( as_dictionary: bool = ..., ) -> Union[List[str], Dict[str, str]]: - r"""Return the value(s) passed for the ``-x`` argument, if any. + """Return the value(s) passed for the ``-x`` argument, if any. The ``-x`` argument is an open ended flag that allows any user-defined value or values to be passed on the command line, then available @@ -695,7 +695,7 @@ def get_x_argument( """ def is_offline_mode() -> bool: - r"""Return True if the current migrations environment + """Return True if the current migrations environment is running in "offline mode". This is ``True`` or ``False`` depending @@ -707,7 +707,7 @@ def is_offline_mode() -> bool: """ def is_transactional_ddl(): - r"""Return True if the context is configured to expect a + """Return True if the context is configured to expect a transactional DDL capable backend. This defaults to the type of database in use, and @@ -720,7 +720,7 @@ def is_transactional_ddl(): """ def run_migrations(**kw: Any) -> None: - r"""Run migrations as determined by the current command line + """Run migrations as determined by the current command line configuration as well as versioning information present (or not) in the current database connection (if one is present). @@ -743,7 +743,7 @@ def run_migrations(**kw: Any) -> None: script: ScriptDirectory def static_output(text: str) -> None: - r"""Emit text directly to the "offline" SQL stream. + """Emit text directly to the "offline" SQL stream. Typically this is for emitting comments that start with --. The statement is not treated |