|
| 1 | +from collections.abc import Callable |
| 2 | +from logging import Logger |
| 3 | +from typing import Any, TypeVar |
| 4 | +from typing_extensions import ParamSpec |
| 5 | + |
| 6 | +from alembic.config import Config as AlembicConfig |
| 7 | +from flask_sqlalchemy import SQLAlchemy |
| 8 | +from sqlalchemy import MetaData |
| 9 | + |
| 10 | +_T = TypeVar("_T") |
| 11 | +_P = ParamSpec("_P") |
| 12 | +_App = Any # flask.Flask is not possible as a dependency yet |
| 13 | + |
| 14 | +alembic_version: tuple[int, int, int] |
| 15 | +log: Logger |
| 16 | + |
| 17 | +class _MigrateConfig: |
| 18 | + migrate: Migrate |
| 19 | + db: SQLAlchemy | None |
| 20 | + directory: str |
| 21 | + configure_args: dict[str, Any] |
| 22 | + def __init__(self, migrate: Migrate, db: SQLAlchemy | None, **kwargs) -> None: ... |
| 23 | + @property |
| 24 | + def metadata(self) -> MetaData: ... |
| 25 | + |
| 26 | +class Config(AlembicConfig): |
| 27 | + template_directory: str | None |
| 28 | + def __init__(self, *args, **kwargs) -> None: ... |
| 29 | + def get_template_directory(self) -> str: ... |
| 30 | + |
| 31 | +class Migrate: |
| 32 | + configure_callbacks: list[Callable[[Config], None]] |
| 33 | + db: SQLAlchemy | None |
| 34 | + directory: str |
| 35 | + alembic_ctx_kwargs: dict[str, Any] |
| 36 | + def __init__(self, app: _App | None = ..., db: SQLAlchemy | None = ..., directory: str = ..., **kwargs) -> None: ... |
| 37 | + def init_app(self, app: _App, db: SQLAlchemy | None = ..., directory: str | None = ..., **kwargs) -> None: ... |
| 38 | + def configure(self, f: Callable[[Config], None]) -> Callable[[Config], None]: ... |
| 39 | + def call_configure_callbacks(self, config: Config): ... |
| 40 | + def get_config(self, directory: str | None = ..., x_arg: tuple[str] | None = ..., opts: list[str] | None = ...): ... |
| 41 | + |
| 42 | +def catch_errors(f: Callable[_P, _T]) -> Callable[_P, _T]: ... |
| 43 | +def list_templates() -> None: ... |
| 44 | +def init(directory: str | None = ..., multidb: bool = ..., template: str | None = ..., package: bool = ...) -> None: ... |
| 45 | +def revision( |
| 46 | + directory: str | None = ..., |
| 47 | + message: str | None = ..., |
| 48 | + autogenerate: bool = ..., |
| 49 | + sql: bool = ..., |
| 50 | + head: str = ..., |
| 51 | + splice: bool = ..., |
| 52 | + branch_label: str | None = ..., |
| 53 | + version_path: str | None = ..., |
| 54 | + rev_id: str | None = ..., |
| 55 | +) -> None: ... |
| 56 | +def migrate( |
| 57 | + directory: str | None = ..., |
| 58 | + message: str | None = ..., |
| 59 | + sql: bool = ..., |
| 60 | + head: str = ..., |
| 61 | + splice: bool = ..., |
| 62 | + branch_label: str | None = ..., |
| 63 | + version_path: str | None = ..., |
| 64 | + rev_id: str | None = ..., |
| 65 | + x_arg: tuple[str] | None = ..., |
| 66 | +) -> None: ... |
| 67 | +def edit(directory: str | None = ..., revision: str = ...) -> None: ... |
| 68 | +def merge( |
| 69 | + directory: str | None = ..., |
| 70 | + revisions: str = ..., |
| 71 | + message: str | None = ..., |
| 72 | + branch_label: str | None = ..., |
| 73 | + rev_id: str | None = ..., |
| 74 | +) -> None: ... |
| 75 | +def upgrade( |
| 76 | + directory: str | None = ..., revision: str = ..., sql: bool = ..., tag: str | None = ..., x_arg: tuple[str] | None = ... |
| 77 | +) -> None: ... |
| 78 | +def downgrade( |
| 79 | + directory: str | None = ..., revision: str = ..., sql: bool = ..., tag: str | None = ..., x_arg: tuple[str] | None = ... |
| 80 | +) -> None: ... |
| 81 | +def show(directory: str | None = ..., revision: str = ...) -> None: ... |
| 82 | +def history( |
| 83 | + directory: str | None = ..., rev_range: str | None = ..., verbose: bool = ..., indicate_current: bool = ... |
| 84 | +) -> None: ... |
| 85 | +def heads(directory: str | None = ..., verbose: bool = ..., resolve_dependencies: bool = ...) -> None: ... |
| 86 | +def branches(directory: str | None = ..., verbose: bool = ...) -> None: ... |
| 87 | +def current(directory: str | None = ..., verbose: bool = ...) -> None: ... |
| 88 | +def stamp(directory: str | None = ..., revision: str = ..., sql: bool = ..., tag: str | None = ...) -> None: ... |
0 commit comments