
    g"                   \   S SK Jr  S SKJr  S SKrS SKrS SKJr  S SKJr  S SKJ	r	  S SKJ
r
  S SKJr  S S	KJr  S S
KJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJ r   SSKJ!r!  SSK"J#r#  \(       a  S SKJ$r$  S S K%J&r&  S S!K'J(r(  S S"K)J*r*  S S#K+J,r,  S S$K+J-r-  S S%K+J.r.  S S&K/J0r0  S S'K1J2r2  S S(K1J3r3  S S)K1J4r4  S S*K1J5r5  S S+K6J7r7  SS,KJ8r8  SS-K9J:r:  SS.K9J;r;  SS/K9J<r<  SS0K9J=r=  SS1K9J>r>  SS2K9J?r?  SS3K9J@r@  SS4K9JArA  SS5K9JBrB  SS6K9JCrC  SS7K9JDrD  SS8K9JErE  SS9K9JFrF  SS:K9JGrG  SS;K9JHrH  SS<KIJJrJ  SS=KKJLrL  S>rM\" S?5      rN\" S@\	SA\4   SB9rO " SC SD\R                  5      rQ " SE SF\Q5      rR " SG SH\Q5      rSg)I    )annotations)contextmanagerN)Any)	Awaitable)Callable)Dict)Iterator)List)Mapping)NoReturn)Optional)overload)Sequence)Tuple)Type)TYPE_CHECKING)TypeVar)Unionconv   )batch)	schemaobj   )util)sqla_compat)formatannotation_fwdref)inspect_formatargspec)inspect_getfullargspec)_literal_bindparam)Literal)Table)
Connection)
Executable)ColumnElement)TableClause)
TextClause)Function)Column)Computed)Identity)
SchemaItem)
TypeEngine)BatchOperationsImpl)AddColumnOp)AddConstraintOp)AlterColumnOp)AlterTableOp)BulkInsertOp)CreateIndexOp)CreateTableCommentOp)CreateTableOp)DropColumnOp)DropConstraintOp)DropIndexOp)DropTableCommentOp)DropTableOp)ExecuteSQLOp)MigrateOperation)DefaultImpl)MigrationContext)
OperationsBatchOperations_T_C.)boundc            
         \ rS rSr% SrS\S'   \R                  " 5       r S     SS jjr	\
 S     SS jj5       r\
SS j5       r\
\    SS	 j5       5       r\SS
SSS\R                  " 5       S\R                  " 5       S4	                     SS jj5       rSS jr\SS j5       r\    SS j5       r\S S j5       rS S jrS!S jr S     S"S jjrS#S jr        S$S jrSrg)%AbstractOperationsM   zJBase class for Operations and BatchOperations.

.. versionadded:: 1.11.0

z'Union[DefaultImpl, BatchOperationsImpl]implNc                |    Xl         Uc  UR                  U l        OX l        [        R                  " U5      U l        g)ziConstruct a new :class:`.Operations`

:param migration_context: a :class:`.MigrationContext`
 instance.

N)migration_contextrH   r   SchemaObjects
schema_obj)selfrJ   rH   s      _/Users/Alptekin/Desktop/izin_takip/venv/lib/python3.13/site-packages/alembic/operations/base.py__init__AbstractOperations.__init__W   s4     "3<)..DII#112CD    c                    ^ ^^ SU UU4S jjnU$ )a  Register a new operation for this class.

This method is normally used to add new operations
to the :class:`.Operations` class, and possibly the
:class:`.BatchOperations` class as well.   All Alembic migration
operations are implemented via this system, however the system
is also available as a public API to facilitate adding custom
operations.

.. seealso::

    :ref:`operation_plugins`


c           	     V  > Tc  [        U T5      nUR                  nO[        U T5      nUR                  n[        U5      nUS   nUSS SS/:X  d   eS/USS& [        US[        06nUS   (       a  [        US   5      OSnU(       a  [        USU-
  S  5      nOSnU[        US	   5      -  n[        XCS	   -   US
   US   US [        S9n[        R                  " SS U5      n[        R                  " STUUUUR                  S.-  5      n	[        [        5       5      n
U
R                  SU 05        0 n[        XU5        [!        TTUT   5        STR                  < STR                  < ST< S3UR"                  l        [%        US5      (       a  UR&                  UT   l        U $ )Nr   r   cls
operationsrM   formatannotation       r   c                    SU -   $ )N=rX   )xs    rN   <lambda>IAbstractOperations.register_operation.<locals>.register.<locals>.<lambda>   s    cAgrQ   )formatvaluerV   z![_]?ForwardRef\(([\'"].+?[\'"])\)c                $    U R                  S5      $ )Nr   )group)ms    rN   r]   r^      s    !''!*rQ   z            def %(name)s%(args)s:
                %(doc)r
                return op_cls.%(source_name)s%(apply_kw)s
            )namesource_nameargsapply_kwdocop_clsz'This method is proxied on the :class:`.z` class, via the :meth:`..z	` method._legacy_translations)getattr__name__r   r   r   lentupleresubtextwrapdedent__doc__dictglobalsupdateexecsetattr__func__hasattrrj   )rh   fnrd   spec	name_argsre   num_defaultsdefaulted_valsrf   	func_textglobals_lclrT   rc   
sourcenames               rN   register7AbstractOperations.register_operation.<locals>.register~   s   !VT* kkVZ0 kk)"-DQIQq>e\%::::$XIaN((?D ,073tAw<L !&y\1A1C'D!E!#eDGn,N
 -G#QQ-!8H 664$D ! !#.  (::I GIHOOXv./"$Cc*Cs4y) <<t5 KK
 r122131H1HD	.MrQ   )rh   Type[_T]returnr   rX   )rT   rc   r   r   s   ``` rN   register_operation%AbstractOperations.register_operationj   s    (K	 K	Z rQ   c                   ^ ^ SU U4S jjnU$ )zRegister an implementation for a given :class:`.MigrateOperation`.

This is part of the operation extensibility API.

.. seealso::

    :ref:`operation_plugins` - example of use

c                J   > TR                   R                  T5      " U 5        U $ N)_to_impldispatch_for)r{   rT   rh   s    rN   decorate7AbstractOperations.implementation_for.<locals>.decorate   s    LL%%f-b1IrQ   )r{   rC   r   rC   rX   )rT   rh   r   s   `` rN   implementation_for%AbstractOperations.implementation_for   s    	 	 rQ   c              #  j   #    [        U5      nUR                  5         Uv   UR                  5         g 7fr   )r@   _install_proxy_remove_proxy)rT   rJ   ops      rN   contextAbstractOperations.context   s/     
 )*

s   13autorX   c              #     #    [         R                  " U UUUUUUUU	U
U5      n[        U R                  US9nUv   UR	                  5         g7f)a  Invoke a series of per-table migrations in batch.

Batch mode allows a series of operations specific to a table
to be syntactically grouped together, and allows for alternate
modes of table migration, in particular the "recreate" style of
migration required by SQLite.

"recreate" style is as follows:

1. A new table is created with the new specification, based on the
   migration directives within the batch, using a temporary name.

2. the data copied from the existing table to the new table.

3. the existing table is dropped.

4. the new table is renamed to the existing table name.

The directive by default will only use "recreate" style on the
SQLite backend, and only if directives are present which require
this form, e.g. anything other than ``add_column()``.   The batch
operation on other backends will proceed using standard ALTER TABLE
operations.

The method is used as a context manager, which returns an instance
of :class:`.BatchOperations`; this object is the same as
:class:`.Operations` except that table names and schema names
are omitted.  E.g.::

    with op.batch_alter_table("some_table") as batch_op:
        batch_op.add_column(Column("foo", Integer))
        batch_op.drop_column("bar")

The operations within the context manager are invoked at once
when the context is ended.   When run against SQLite, if the
migrations include operations not supported by SQLite's ALTER TABLE,
the entire table will be copied to a new one with the new
specification, moving all data across as well.

The copy operation by default uses reflection to retrieve the current
structure of the table, and therefore :meth:`.batch_alter_table`
in this mode requires that the migration is run in "online" mode.
The ``copy_from`` parameter may be passed which refers to an existing
:class:`.Table` object, which will bypass this reflection step.

.. note::  The table copy operation will currently not copy
   CHECK constraints, and may not copy UNIQUE constraints that are
   unnamed, as is possible on SQLite.   See the section
   :ref:`sqlite_batch_constraints` for workarounds.

:param table_name: name of table
:param schema: optional schema name.
:param recreate: under what circumstances the table should be
 recreated. At its default of ``"auto"``, the SQLite dialect will
 recreate the table if any operations other than ``add_column()``,
 ``create_index()``, or ``drop_index()`` are
 present. Other options include ``"always"`` and ``"never"``.
:param copy_from: optional :class:`~sqlalchemy.schema.Table` object
 that will act as the structure of the table being copied.  If omitted,
 table reflection is used to retrieve the structure of the table.

 .. seealso::

    :ref:`batch_offline_mode`

    :paramref:`~.Operations.batch_alter_table.reflect_args`

    :paramref:`~.Operations.batch_alter_table.reflect_kwargs`

:param reflect_args: a sequence of additional positional arguments that
 will be applied to the table structure being reflected / copied;
 this may be used to pass column and constraint overrides to the
 table that will be reflected, in lieu of passing the whole
 :class:`~sqlalchemy.schema.Table` using
 :paramref:`~.Operations.batch_alter_table.copy_from`.
:param reflect_kwargs: a dictionary of additional keyword arguments
 that will be applied to the table structure being copied; this may be
 used to pass additional table and reflection options to the table that
 will be reflected, in lieu of passing the whole
 :class:`~sqlalchemy.schema.Table` using
 :paramref:`~.Operations.batch_alter_table.copy_from`.
:param table_args: a sequence of additional positional arguments that
 will be applied to the new :class:`~sqlalchemy.schema.Table` when
 created, in addition to those copied from the source table.
 This may be used to provide additional constraints such as CHECK
 constraints that may not be reflected.
:param table_kwargs: a dictionary of additional keyword arguments
 that will be applied to the new :class:`~sqlalchemy.schema.Table`
 when created, in addition to those copied from the source table.
 This may be used to provide for additional table options that may
 not be reflected.
:param naming_convention: a naming convention dictionary of the form
 described at :ref:`autogen_naming_conventions` which will be applied
 to the :class:`~sqlalchemy.schema.MetaData` during the reflection
 process.  This is typically required if one wants to drop SQLite
 constraints, as these constraints will not have names when
 reflected on this backend.  Requires SQLAlchemy **0.9.4** or greater.

 .. seealso::

    :ref:`dropping_sqlite_foreign_keys`

:param partial_reordering: a list of tuples, each suggesting a desired
 ordering of two or more columns in the newly created table.  Requires
 that :paramref:`.batch_alter_table.recreate` is set to ``"always"``.
 Examples, given a table with columns "a", "b", "c", and "d":

 Specify the order of all columns::

    with op.batch_alter_table(
        "some_table",
        recreate="always",
        partial_reordering=[("c", "d", "a", "b")],
    ) as batch_op:
        pass

 Ensure "d" appears before "c", and "b", appears before "a"::

    with op.batch_alter_table(
        "some_table",
        recreate="always",
        partial_reordering=[("d", "c"), ("b", "a")],
    ) as batch_op:
        pass

 The ordering of columns not included in the partial_reordering
 set is undefined.   Therefore it is best to specify the complete
 ordering of all columns for best results.

.. note:: batch mode requires SQLAlchemy 0.8 or above.

.. seealso::

    :ref:`batch_migrations`

)rH   N)r   r.   rA   rJ   flush)rM   
table_nameschemarecreatepartial_reordering	copy_from
table_argstable_kwargsreflect_argsreflect_kwargsnaming_conventionrH   batch_ops                rN   batch_alter_table$AbstractOperations.batch_alter_table   s[     l ((
 #4#9#9E

s   A
Ac                    U R                   $ )zGReturn the :class:`.MigrationContext` object that's
currently in use.

)rJ   rM   s    rN   get_contextAbstractOperations.get_context  s     %%%rQ   c                    g r   rX   rM   	operations     rN   invokeAbstractOperations.invoke  s    9<rQ   c                    g r   rX   r   s     rN   r   r     s    $ rQ   c                    g r   rX   r   s     rN   r   r     s    :=rQ   c                    U R                   R                  XR                  R                  R                  5      nU" X5      $ )z_Given a :class:`.MigrateOperation`, invoke it in terms of
this :class:`.Operations` instance.

)r   dispatchrJ   rH   __dialect__)rM   r   r{   s      rN   r   r     s:    
 ]]##--22>>
 $""rQ   c                    [        U5      $ )a  Indicate a string name that has already had a naming convention
applied to it.

This feature combines with the SQLAlchemy ``naming_convention`` feature
to disambiguate constraint names that have already had naming
conventions applied to them, versus those that have not.  This is
necessary in the case that the ``"%(constraint_name)s"`` token
is used within a naming convention, so that it can be identified
that this particular name should remain fixed.

If the :meth:`.Operations.f` is used on a constraint, the naming
convention will not take effect::

    op.add_column("t", "x", Boolean(name=op.f("ck_bool_t_x")))

Above, the CHECK constraint generated will have the name
``ck_bool_t_x`` regardless of whether or not a naming convention is
in use.

Alternatively, if a naming convention is in use, and 'f' is not used,
names will be converted along conventions.  If the ``target_metadata``
contains the naming convention
``{"ck": "ck_bool_%(table_name)s_%(constraint_name)s"}``, then the
output of the following:

    op.add_column("t", "x", Boolean(name="x"))

will be::

    CONSTRAINT ck_bool_t_x CHECK (x in (1, 0)))

The function is rendered in the output of autogenerate when
a particular constraint name is already converted.

r   )rM   rc   s     rN   fAbstractOperations.f  s    H DzrQ   c                ,    [         R                  " SXS9$ )ae  Produce an 'inline literal' expression, suitable for
using in an INSERT, UPDATE, or DELETE statement.

When using Alembic in "offline" mode, CRUD operations
aren't compatible with SQLAlchemy's default behavior surrounding
literal values,
which is that they are converted into bound values and passed
separately into the ``execute()`` method of the DBAPI cursor.
An offline SQL
script needs to have these rendered inline.  While it should
always be noted that inline literal values are an **enormous**
security hole in an application that handles untrusted input,
a schema migration is not run in this context, so
literals are safe to render inline, with the caveat that
advanced types like dates may not be supported directly
by SQLAlchemy.

See :meth:`.Operations.execute` for an example usage of
:meth:`.Operations.inline_literal`.

The environment can also be configured to attempt to render
"literal" values inline automatically, for those simple types
that are supported by the dialect; see
:paramref:`.EnvironmentContext.configure.literal_binds` for this
more recently added feature.

:param value: The value to render.  Strings, integers, and simple
 numerics should be supported.   Other types like boolean,
 dates, etc. may or may not be supported yet by various
 backends.
:param type\_: optional - a :class:`sqlalchemy.types.TypeEngine`
 subclass stating the type of this value.  In SQLAlchemy
 expressions, this is usually derived automatically
 from the Python type of the value itself, as well as
 based on the context in which the value is used.

.. seealso::

    :paramref:`.EnvironmentContext.configure.literal_binds`

N)type_)r   r    )rM   valuer   s      rN   inline_literal!AbstractOperations.inline_literal  s    X --dEGGrQ   c                B    U R                   R                  R                  $ )zReturn the current 'bind'.

Under normal circumstances, this is the
:class:`~sqlalchemy.engine.Connection` currently being used
to emit SQL to the database.

In a SQL script context, this value is ``None``. [TODO: verify this]

)rJ   rH   bindr   s    rN   get_bindAbstractOperations.get_bind  s     %%**///rQ   c                (   [         R                  (       d  [        S5      eU R                  5       nUc  [        S5      eUR                  R
                  (       d  [        S5      eSSKJn  SSK	J
n  UR                  U5      nU" U" U/UQ70 UD65      $ )ab  Invoke the given asynchronous callable, passing an asynchronous
:class:`~sqlalchemy.ext.asyncio.AsyncConnection` as the first
argument.

This method allows calling async functions from within the
synchronous ``upgrade()`` or ``downgrade()`` alembic migration
method.

The async connection passed to the callable shares the same
transaction as the connection running in the migration context.

Any additional arg or kw_arg passed to this function are passed
to the provided async function.

.. versionadded: 1.11

.. note::

    This method can be called only when alembic is called using
    an async dialect.
zSQLAlchemy 1.4.18+ requiredz!Cannot call run_async in SQL modez(Cannot call run_async with a sync enginer   )AsyncConnection)
await_only)r   
sqla_14_18NotImplementedErrorr   dialectis_async
ValueErrorsqlalchemy.ext.asyncior   sqlalchemy.utilr   _retrieve_proxy_for_target)rM   async_functionre   kw_args	sync_connr   r   
async_conns           rN   	run_asyncAbstractOperations.run_async  s    6 %%%&CDDMMO	%&IJJ  ))GHH:.$??	J
.FdFgFGGrQ   )rH   rJ   rL   r   )rJ   r?   rH   zOptional[BatchOperationsImpl]r   None)rc   strr   Optional[str]r   zCallable[[Type[_T]], Type[_T]])rh   r   r   zCallable[[_C], _C])rJ   r?   r   zIterator[Operations])r   r   r   r   r   z"Literal['auto', 'always', 'never']r   zOptional[Tuple[Any, ...]]r   Optional[Table]r   Tuple[Any, ...]r   Mapping[str, Any]r   r   r   r   r   zOptional[Dict[str, str]]r   zIterator[BatchOperations])r   r?   )r   r6   r   r"   )r   zUnion[AddConstraintOp, DropConstraintOp, CreateIndexOp, DropIndexOp, AddColumnOp, AlterColumnOp, AlterTableOp, CreateTableCommentOp, DropTableCommentOp, DropColumnOp, BulkInsertOp, DropTableOp, ExecuteSQLOp]r   r   )r   r=   r   r   )rc   r   r   r   )r   zUnion[str, int]r   zOptional[TypeEngine[Any]]r   r    )r   r#   )r   zCallable[..., Awaitable[_T]]re   r   r   r   r   rB   )rl   
__module____qualname____firstlineno__rs   __annotations__r   
Dispatcherr   rO   classmethodr   r   r   r   immutabledictr   r   r   r   r   r   r   r   __static_attributes__rX   rQ   rN   rF   rF   M   s+    21 H
 /3E+E ,E 
	E& 48``$1`	'` `D  "  0	    !%7=8<%)&(*.*<*<*>(*,0,>,>,@6:dd d 5	d
 6d #d $d (d &d *d 4d 
#d dL& < <
" 
# & = =#$N JN,H$,H-F,H	,H\
0&H4&H &H 	&H
 
&HrQ   rF   c                  .   \ rS rSrSr\(       Ga  SS.       S"S jjrSSSSSSSSSSS.
                           S#S jjrS	S
.       S$S jjrSS.           S%S jjr	          S&S jr
SSSSSSSS.                           S'S jjrSSSS.               S(S jjrSS.         S)S jjrSS.         S*S jjrSSS.         S+S jjrSS.           S,S jjrSS.         S-S jjr S.SS.         S/S jjjr S.SSS.           S0S jjjrSSS.         S1S jjrSSS.       S2S jjrSS.     S3S jjrSS.       S4S  jjrS!rgS!rg)5r@   iE  a  Define high level migration operations.

Each operation corresponds to some schema migration operation,
executed against a particular :class:`.MigrationContext`
which in turn represents connectivity to a database,
or a file output stream.

While :class:`.Operations` is normally configured as
part of the :meth:`.EnvironmentContext.run_migrations`
method called from an ``env.py`` script, a standalone
:class:`.Operations` instance can be
made for use cases external to regular Alembic
migrations by passing in a :class:`.MigrationContext`::

    from alembic.migration import MigrationContext
    from alembic.operations import Operations

    conn = myengine.connect()
    ctx = MigrationContext.configure(conn)
    op = Operations(ctx)

    op.alter_column("t", "c", nullable=True)

Note that as of 0.8, most of the methods on this class are produced
dynamically using the :meth:`.Operations.register_operation`
method.

N)r   c                   g)a  Issue an "add column" instruction using the current
migration context.

e.g.::

    from alembic import op
    from sqlalchemy import Column, String

    op.add_column("organization", Column("name", String()))

The :meth:`.Operations.add_column` method typically corresponds
to the SQL command "ALTER TABLE... ADD COLUMN".    Within the scope
of this command, the column's name, datatype, nullability,
and optional server-generated defaults may be indicated.

.. note::

    With the exception of NOT NULL constraints or single-column FOREIGN
    KEY constraints, other kinds of constraints such as PRIMARY KEY,
    UNIQUE or CHECK constraints **cannot** be generated using this
    method; for these constraints, refer to operations such as
    :meth:`.Operations.create_primary_key` and
    :meth:`.Operations.create_check_constraint`. In particular, the
    following :class:`~sqlalchemy.schema.Column` parameters are
    **ignored**:

    * :paramref:`~sqlalchemy.schema.Column.primary_key` - SQL databases
      typically do not support an ALTER operation that can add
      individual columns one at a time to an existing primary key
      constraint, therefore it's less ambiguous to use the
      :meth:`.Operations.create_primary_key` method, which assumes no
      existing primary key constraint is present.
    * :paramref:`~sqlalchemy.schema.Column.unique` - use the
      :meth:`.Operations.create_unique_constraint` method
    * :paramref:`~sqlalchemy.schema.Column.index` - use the
      :meth:`.Operations.create_index` method


The provided :class:`~sqlalchemy.schema.Column` object may include a
:class:`~sqlalchemy.schema.ForeignKey` constraint directive,
referencing a remote table name. For this specific type of constraint,
Alembic will automatically emit a second ALTER statement in order to
add the single-column FOREIGN KEY constraint separately::

    from alembic import op
    from sqlalchemy import Column, INTEGER, ForeignKey

    op.add_column(
        "organization",
        Column("account_id", INTEGER, ForeignKey("accounts.id")),
    )

The column argument passed to :meth:`.Operations.add_column` is a
:class:`~sqlalchemy.schema.Column` construct, used in the same way it's
used in SQLAlchemy. In particular, values or functions to be indicated
as producing the column's default value on the database side are
specified using the ``server_default`` parameter, and not ``default``
which only specifies Python-side defaults::

    from alembic import op
    from sqlalchemy import Column, TIMESTAMP, func

    # specify "DEFAULT NOW" along with the column add
    op.add_column(
        "account",
        Column("timestamp", TIMESTAMP, server_default=func.now()),
    )

:param table_name: String name of the parent table.
:param column: a :class:`sqlalchemy.schema.Column` object
 representing the new column.
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.

NrX   )rM   r   columnr   s       rN   
add_columnOperations.add_columnh  s    h rQ   F)
nullablecommentserver_defaultnew_column_namer   existing_typeexisting_server_defaultexisting_nullableexisting_commentr   c       
            g)a  Issue an "alter column" instruction using the
current migration context.

Generally, only that aspect of the column which
is being changed, i.e. name, type, nullability,
default, needs to be specified.  Multiple changes
can also be specified at once and the backend should
"do the right thing", emitting each change either
separately or together as the backend allows.

MySQL has special requirements here, since MySQL
cannot ALTER a column without a full specification.
When producing MySQL-compatible migration files,
it is recommended that the ``existing_type``,
``existing_server_default``, and ``existing_nullable``
parameters be present, if not being altered.

Type changes which are against the SQLAlchemy
"schema" types :class:`~sqlalchemy.types.Boolean`
and  :class:`~sqlalchemy.types.Enum` may also
add or drop constraints which accompany those
types on backends that don't support them natively.
The ``existing_type`` argument is
used in this case to identify and remove a previous
constraint that was bound to the type object.

:param table_name: string name of the target table.
:param column_name: string name of the target column,
 as it exists before the operation begins.
:param nullable: Optional; specify ``True`` or ``False``
 to alter the column's nullability.
:param server_default: Optional; specify a string
 SQL expression, :func:`~sqlalchemy.sql.expression.text`,
 or :class:`~sqlalchemy.schema.DefaultClause` to indicate
 an alteration to the column's default value.
 Set to ``None`` to have the default removed.
:param comment: optional string text of a new comment to add to the
 column.
:param new_column_name: Optional; specify a string name here to
 indicate the new name within a column rename operation.
:param type\_: Optional; a :class:`~sqlalchemy.types.TypeEngine`
 type object to specify a change to the column's type.
 For SQLAlchemy types that also indicate a constraint (i.e.
 :class:`~sqlalchemy.types.Boolean`, :class:`~sqlalchemy.types.Enum`),
 the constraint is also generated.
:param autoincrement: set the ``AUTO_INCREMENT`` flag of the column;
 currently understood by the MySQL dialect.
:param existing_type: Optional; a
 :class:`~sqlalchemy.types.TypeEngine`
 type object to specify the previous type.   This
 is required for all MySQL column alter operations that
 don't otherwise specify a new type, as well as for
 when nullability is being changed on a SQL Server
 column.  It is also used if the type is a so-called
 SQLAlchemy "schema" type which may define a constraint (i.e.
 :class:`~sqlalchemy.types.Boolean`,
 :class:`~sqlalchemy.types.Enum`),
 so that the constraint can be dropped.
:param existing_server_default: Optional; The existing
 default value of the column.   Required on MySQL if
 an existing default is not being changed; else MySQL
 removes the default.
:param existing_nullable: Optional; the existing nullability
 of the column.  Required on MySQL if the existing nullability
 is not being changed; else MySQL sets this to NULL.
:param existing_autoincrement: Optional; the existing autoincrement
 of the column.  Used for MySQL's system of altering a column
 that specifies ``AUTO_INCREMENT``.
:param existing_comment: string text of the existing comment on the
 column to be maintained.  Required on MySQL if the existing comment
 on the column is not being changed.
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.
:param postgresql_using: String argument which will indicate a
 SQL expression to render within the Postgresql-specific USING clause
 within ALTER COLUMN.    This string is taken directly as raw SQL which
 must explicitly include any necessary quoting or escaping of tokens
 within the expression.

NrX   )rM   r   column_namer   r   r   r   r   r   r   r   r   r   kws                 rN   alter_columnOperations.alter_column  s    N rQ   T)multiinsertc                   g)a  Issue a "bulk insert" operation using the current
migration context.

This provides a means of representing an INSERT of multiple rows
which works equally well in the context of executing on a live
connection as well as that of generating a SQL script.   In the
case of a SQL script, the values are rendered inline into the
statement.

e.g.::

    from alembic import op
    from datetime import date
    from sqlalchemy.sql import table, column
    from sqlalchemy import String, Integer, Date

    # Create an ad-hoc table to use for the insert statement.
    accounts_table = table(
        "account",
        column("id", Integer),
        column("name", String),
        column("create_date", Date),
    )

    op.bulk_insert(
        accounts_table,
        [
            {
                "id": 1,
                "name": "John Smith",
                "create_date": date(2010, 10, 5),
            },
            {
                "id": 2,
                "name": "Ed Williams",
                "create_date": date(2007, 5, 27),
            },
            {
                "id": 3,
                "name": "Wendy Jones",
                "create_date": date(2008, 8, 15),
            },
        ],
    )

When using --sql mode, some datatypes may not render inline
automatically, such as dates and other special types.   When this
issue is present, :meth:`.Operations.inline_literal` may be used::

    op.bulk_insert(
        accounts_table,
        [
            {
                "id": 1,
                "name": "John Smith",
                "create_date": op.inline_literal("2010-10-05"),
            },
            {
                "id": 2,
                "name": "Ed Williams",
                "create_date": op.inline_literal("2007-05-27"),
            },
            {
                "id": 3,
                "name": "Wendy Jones",
                "create_date": op.inline_literal("2008-08-15"),
            },
        ],
        multiinsert=False,
    )

When using :meth:`.Operations.inline_literal` in conjunction with
:meth:`.Operations.bulk_insert`, in order for the statement to work
in "online" (e.g. non --sql) mode, the
:paramref:`~.Operations.bulk_insert.multiinsert`
flag should be set to ``False``, which will have the effect of
individual INSERT statements being emitted to the database, each
with a distinct VALUES clause, so that the "inline" values can
still be rendered, rather than attempting to pass the values
as bound parameters.

:param table: a table object which represents the target of the INSERT.

:param rows: a list of dictionaries indicating rows.

:param multiinsert: when at its default of True and --sql mode is not
   enabled, the INSERT statement will be executed using
   "executemany()" style, where all elements in the list of
   dictionaries are passed as bound parameters in a single
   list.   Setting this to False results in individual INSERT
   statements being emitted per parameter set, and is needed
   in those cases where non-literal values are present in the
   parameter sets.

NrX   )rM   tablerowsr   s       rN   bulk_insertOperations.bulk_insert'  s    L rQ   c                   g)a  Issue a "create check constraint" instruction using the
current migration context.

e.g.::

    from alembic import op
    from sqlalchemy.sql import column, func

    op.create_check_constraint(
        "ck_user_name_len",
        "user",
        func.len(column("name")) > 5,
    )

CHECK constraints are usually against a SQL expression, so ad-hoc
table metadata is usually needed.   The function will convert the given
arguments into a :class:`sqlalchemy.schema.CheckConstraint` bound
to an anonymous table in order to emit the CREATE statement.

:param name: Name of the check constraint.  The name is necessary
 so that an ALTER statement can be emitted.  For setups that
 use an automated naming scheme such as that described at
 :ref:`sqla:constraint_naming_conventions`,
 ``name`` here can be ``None``, as the event listener will
 apply the name to the constraint object when it is associated
 with the table.
:param table_name: String name of the source table.
:param condition: SQL expression that's the condition of the
 constraint. Can be a string or SQLAlchemy expression language
 structure.
:param deferrable: optional bool. If set, emit DEFERRABLE or
 NOT DEFERRABLE when issuing DDL for this constraint.
:param initially: optional string. If set, emit INITIALLY <value>
 when issuing DDL for this constraint.
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.

NrX   )rM   constraint_namer   	conditionr   r   s         rN   create_check_constraint"Operations.create_check_constraint  s    b rQ   c                    g)a  Issue an alter to create an EXCLUDE constraint using the
current migration context.

.. note::  This method is Postgresql specific, and additionally
   requires at least SQLAlchemy 1.0.

e.g.::

    from alembic import op

    op.create_exclude_constraint(
        "user_excl",
        "user",
        ("period", "&&"),
        ("group", "="),
        where=("group != 'some group'"),
    )

Note that the expressions work the same way as that of
the ``ExcludeConstraint`` object itself; if plain strings are
passed, quoting rules must be applied manually.

:param name: Name of the constraint.
:param table_name: String name of the source table.
:param elements: exclude conditions.
:param where: SQL expression or SQL string with optional WHERE
 clause.
:param deferrable: optional bool. If set, emit DEFERRABLE or
 NOT DEFERRABLE when issuing DDL for this constraint.
:param initially: optional string. If set, emit INITIALLY <value>
 when issuing DDL for this constraint.
:param schema: Optional schema name to operate within.

NrX   )rM   r   r   elementsr   s        rN   create_exclude_constraint$Operations.create_exclude_constraint  s    R rQ   )onupdateondelete
deferrable	initiallymatchsource_schemareferent_schemac                   g)af  Issue a "create foreign key" instruction using the
current migration context.

e.g.::

    from alembic import op

    op.create_foreign_key(
        "fk_user_address",
        "address",
        "user",
        ["user_id"],
        ["id"],
    )

This internally generates a :class:`~sqlalchemy.schema.Table` object
containing the necessary columns, then generates a new
:class:`~sqlalchemy.schema.ForeignKeyConstraint`
object which it then associates with the
:class:`~sqlalchemy.schema.Table`.
Any event listeners associated with this action will be fired
off normally.   The :class:`~sqlalchemy.schema.AddConstraint`
construct is ultimately used to generate the ALTER statement.

:param constraint_name: Name of the foreign key constraint.  The name
 is necessary so that an ALTER statement can be emitted.  For setups
 that use an automated naming scheme such as that described at
 :ref:`sqla:constraint_naming_conventions`,
 ``name`` here can be ``None``, as the event listener will
 apply the name to the constraint object when it is associated
 with the table.
:param source_table: String name of the source table.
:param referent_table: String name of the destination table.
:param local_cols: a list of string column names in the
 source table.
:param remote_cols: a list of string column names in the
 remote table.
:param onupdate: Optional string. If set, emit ON UPDATE <value> when
 issuing DDL for this constraint. Typical values include CASCADE,
 DELETE and RESTRICT.
:param ondelete: Optional string. If set, emit ON DELETE <value> when
 issuing DDL for this constraint. Typical values include CASCADE,
 DELETE and RESTRICT.
:param deferrable: optional bool. If set, emit DEFERRABLE or NOT
 DEFERRABLE when issuing DDL for this constraint.
:param source_schema: Optional schema name of the source table.
:param referent_schema: Optional schema name of the destination table.

NrX   )rM   r   source_tablereferent_table
local_colsremote_colsr  r  r  r  r  r  r	  
dialect_kws                 rN   create_foreign_keyOperations.create_foreign_key  s    D rQ   )r   uniqueif_not_existsc                   g)az  Issue a "create index" instruction using the current
migration context.

e.g.::

    from alembic import op

    op.create_index("ik_test", "t1", ["foo", "bar"])

Functional indexes can be produced by using the
:func:`sqlalchemy.sql.expression.text` construct::

    from alembic import op
    from sqlalchemy import text

    op.create_index("ik_test", "t1", [text("lower(foo)")])

:param index_name: name of the index.
:param table_name: name of the owning table.
:param columns: a list consisting of string column names and/or
 :func:`~sqlalchemy.sql.expression.text` constructs.
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.
:param unique: If True, create a unique index.

:param quote: Force quoting of this column's name on or off,
 corresponding to ``True`` or ``False``. When left at its default
 of ``None``, the column identifier will be quoted according to
 whether the name is case sensitive (identifiers with at least one
 upper case character are treated as case sensitive), or if it's a
 reserved word. This flag is only needed to force quoting of a
 reserved word which is not known by the SQLAlchemy dialect.

:param if_not_exists: If True, adds IF NOT EXISTS operator when
 creating the new index.

 .. versionadded:: 1.12.0

:param \**kw: Additional keyword arguments not mentioned above are
 dialect specific, and passed in the form
 ``<dialectname>_<argname>``.
 See the documentation regarding an individual dialect at
 :ref:`dialect_toplevel` for detail on documented arguments.

NrX   )rM   
index_namer   columnsr   r  r  r   s           rN   create_indexOperations.create_index1  s    t rQ   c                   g)aJ  Issue a "create primary key" instruction using the current
migration context.

e.g.::

    from alembic import op

    op.create_primary_key("pk_my_table", "my_table", ["id", "version"])

This internally generates a :class:`~sqlalchemy.schema.Table` object
containing the necessary columns, then generates a new
:class:`~sqlalchemy.schema.PrimaryKeyConstraint`
object which it then associates with the
:class:`~sqlalchemy.schema.Table`.
Any event listeners associated with this action will be fired
off normally.   The :class:`~sqlalchemy.schema.AddConstraint`
construct is ultimately used to generate the ALTER statement.

:param constraint_name: Name of the primary key constraint.  The name
 is necessary so that an ALTER statement can be emitted.  For setups
 that use an automated naming scheme such as that described at
 :ref:`sqla:constraint_naming_conventions`
 ``name`` here can be ``None``, as the event listener will
 apply the name to the constraint object when it is associated
 with the table.
:param table_name: String name of the target table.
:param columns: a list of string column names to be applied to the
 primary key constraint.
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.

NrX   )rM   r   r   r  r   s        rN   create_primary_keyOperations.create_primary_keym  s    T rQ   )r  c                   g)a
  Issue a "create table" instruction using the current migration
context.

This directive receives an argument list similar to that of the
traditional :class:`sqlalchemy.schema.Table` construct, but without the
metadata::

    from sqlalchemy import INTEGER, VARCHAR, NVARCHAR, Column
    from alembic import op

    op.create_table(
        "account",
        Column("id", INTEGER, primary_key=True),
        Column("name", VARCHAR(50), nullable=False),
        Column("description", NVARCHAR(200)),
        Column("timestamp", TIMESTAMP, server_default=func.now()),
    )

Note that :meth:`.create_table` accepts
:class:`~sqlalchemy.schema.Column`
constructs directly from the SQLAlchemy library.  In particular,
default values to be created on the database side are
specified using the ``server_default`` parameter, and not
``default`` which only specifies Python-side defaults::

    from alembic import op
    from sqlalchemy import Column, TIMESTAMP, func

    # specify "DEFAULT NOW" along with the "timestamp" column
    op.create_table(
        "account",
        Column("id", INTEGER, primary_key=True),
        Column("timestamp", TIMESTAMP, server_default=func.now()),
    )

The function also returns a newly created
:class:`~sqlalchemy.schema.Table` object, corresponding to the table
specification given, which is suitable for
immediate SQL operations, in particular
:meth:`.Operations.bulk_insert`::

    from sqlalchemy import INTEGER, VARCHAR, NVARCHAR, Column
    from alembic import op

    account_table = op.create_table(
        "account",
        Column("id", INTEGER, primary_key=True),
        Column("name", VARCHAR(50), nullable=False),
        Column("description", NVARCHAR(200)),
        Column("timestamp", TIMESTAMP, server_default=func.now()),
    )

    op.bulk_insert(
        account_table,
        [
            {"name": "A1", "description": "account 1"},
            {"name": "A2", "description": "account 2"},
        ],
    )

:param table_name: Name of the table
:param \*columns: collection of :class:`~sqlalchemy.schema.Column`
 objects within
 the table, as well as optional :class:`~sqlalchemy.schema.Constraint`
 objects
 and :class:`~.sqlalchemy.schema.Index` objects.
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.
:param if_not_exists: If True, adds IF NOT EXISTS operator when
 creating the new table.

 .. versionadded:: 1.13.3
:param \**kw: Other keyword arguments are passed to the underlying
 :class:`sqlalchemy.schema.Table` object created for the command.

:return: the :class:`~sqlalchemy.schema.Table` object corresponding
 to the parameters given.

NrX   )rM   r   r  r  r   s        rN   create_tableOperations.create_table  s    p rQ   )r   r   c                   g)a  Emit a COMMENT ON operation to set the comment for a table.

:param table_name: string name of the target table.
:param comment: string value of the comment being registered against
 the specified table.
:param existing_comment: String value of a comment
 already registered on the specified table, used within autogenerate
 so that the operation is reversible, but not required for direct
 use.

.. seealso::

    :meth:`.Operations.drop_table_comment`

    :paramref:`.Operations.alter_column.comment`

NrX   )rM   r   r   r   r   s        rN   create_table_commentOperations.create_table_comment  s    2 rQ   c                   g)a  Issue a "create unique constraint" instruction using the
current migration context.

e.g.::

    from alembic import op
    op.create_unique_constraint("uq_user_name", "user", ["name"])

This internally generates a :class:`~sqlalchemy.schema.Table` object
containing the necessary columns, then generates a new
:class:`~sqlalchemy.schema.UniqueConstraint`
object which it then associates with the
:class:`~sqlalchemy.schema.Table`.
Any event listeners associated with this action will be fired
off normally.   The :class:`~sqlalchemy.schema.AddConstraint`
construct is ultimately used to generate the ALTER statement.

:param name: Name of the unique constraint.  The name is necessary
 so that an ALTER statement can be emitted.  For setups that
 use an automated naming scheme such as that described at
 :ref:`sqla:constraint_naming_conventions`,
 ``name`` here can be ``None``, as the event listener will
 apply the name to the constraint object when it is associated
 with the table.
:param table_name: String name of the source table.
:param columns: a list of string column names in the
 source table.
:param deferrable: optional bool. If set, emit DEFERRABLE or
 NOT DEFERRABLE when issuing DDL for this constraint.
:param initially: optional string. If set, emit INITIALLY <value>
 when issuing DDL for this constraint.
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.

NrX   )rM   r   r   r  r   r   s         rN   create_unique_constraint#Operations.create_unique_constraint  s    \ rQ   c                   g)a  Issue a "drop column" instruction using the current
migration context.

e.g.::

    drop_column("organization", "account_id")

:param table_name: name of table
:param column_name: name of column
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.
:param mssql_drop_check: Optional boolean.  When ``True``, on
 Microsoft SQL Server only, first
 drop the CHECK constraint on the column using a
 SQL-script-compatible
 block that selects into a @variable from sys.check_constraints,
 then exec's a separate DROP CONSTRAINT for that constraint.
:param mssql_drop_default: Optional boolean.  When ``True``, on
 Microsoft SQL Server only, first
 drop the DEFAULT constraint on the column using a
 SQL-script-compatible
 block that selects into a @variable from sys.default_constraints,
 then exec's a separate DROP CONSTRAINT for that default.
:param mssql_drop_foreign_key: Optional boolean.  When ``True``, on
 Microsoft SQL Server only, first
 drop a single FOREIGN KEY constraint on the column using a
 SQL-script-compatible
 block that selects into a @variable from
 sys.foreign_keys/sys.foreign_key_columns,
 then exec's a separate DROP CONSTRAINT for that default.  Only
 works if the column has exactly one FK constraint which refers to
 it, at the moment.

NrX   )rM   r   r   r   r   s        rN   drop_columnOperations.drop_column>  s    X rQ   c                   g)a  Drop a constraint of the given name, typically via DROP CONSTRAINT.

:param constraint_name: name of the constraint.
:param table_name: table name.
:param type\_: optional, required on MySQL.  can be
 'foreignkey', 'primary', 'unique', or 'check'.
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.

NrX   )rM   r   r   r   r   s        rN   drop_constraintOperations.drop_constraintl  s    ( rQ   )r   	if_existsc                   g)a/  Issue a "drop index" instruction using the current
migration context.

e.g.::

    drop_index("accounts")

:param index_name: name of the index.
:param table_name: name of the owning table.  Some
 backends such as Microsoft SQL Server require this.
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.

:param if_exists: If True, adds IF EXISTS operator when
 dropping the index.

 .. versionadded:: 1.12.0

:param \**kw: Additional keyword arguments not mentioned above are
 dialect specific, and passed in the form
 ``<dialectname>_<argname>``.
 See the documentation regarding an individual dialect at
 :ref:`dialect_toplevel` for detail on documented arguments.

NrX   )rM   r  r   r   r+  r   s         rN   
drop_indexOperations.drop_index      H rQ   c                   g)aH  Issue a "drop table" instruction using the current
migration context.


e.g.::

    drop_table("accounts")

:param table_name: Name of the table
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.
:param if_exists: If True, adds IF EXISTS operator when
 dropping the table.

 .. versionadded:: 1.13.3
:param \**kw: Other keyword arguments are passed to the underlying
 :class:`sqlalchemy.schema.Table` object created for the command.

NrX   )rM   r   r   r+  r   s        rN   
drop_tableOperations.drop_table  s    : rQ   c                   g)ad  Issue a "drop table comment" operation to
remove an existing comment set on a table.

:param table_name: string name of the target table.
:param existing_comment: An optional string value of a comment already
 registered on the specified table.

.. seealso::

    :meth:`.Operations.create_table_comment`

    :paramref:`.Operations.alter_column.comment`

NrX   )rM   r   r   r   s       rN   drop_table_commentOperations.drop_table_comment  s    * rQ   execution_optionsc                   g)a  Execute the given SQL using the current migration context.

The given SQL can be a plain string, e.g.::

    op.execute("INSERT INTO table (foo) VALUES ('some value')")

Or it can be any kind of Core SQL Expression construct, such as
below where we use an update construct::

    from sqlalchemy.sql import table, column
    from sqlalchemy import String
    from alembic import op

    account = table("account", column("name", String))
    op.execute(
        account.update()
        .where(account.c.name == op.inline_literal("account 1"))
        .values({"name": op.inline_literal("account 2")})
    )

Above, we made use of the SQLAlchemy
:func:`sqlalchemy.sql.expression.table` and
:func:`sqlalchemy.sql.expression.column` constructs to make a brief,
ad-hoc table construct just for our UPDATE statement.  A full
:class:`~sqlalchemy.schema.Table` construct of course works perfectly
fine as well, though note it's a recommended practice to at least
ensure the definition of a table is self-contained within the migration
script, rather than imported from a module that may break compatibility
with older migrations.

In a SQL script context, the statement is emitted directly to the
output stream.   There is *no* return result, however, as this
function is oriented towards generating a change script
that can run in "offline" mode.     Additionally, parameterized
statements are discouraged here, as they *will not work* in offline
mode.  Above, we use :meth:`.inline_literal` where parameters are
to be used.

For full interaction with a connected database where parameters can
also be used normally, use the "bind" available from the context::

    from alembic import op

    connection = op.get_bind()

    connection.execute(
        account.update()
        .where(account.c.name == "account 1")
        .values({"name": "account 2"})
    )

Additionally, when passing the statement as a plain string, it is first
coerced into a :func:`sqlalchemy.sql.expression.text` construct
before being passed along.  In the less likely case that the
literal SQL string contains a colon, it must be escaped with a
backslash, as::

   op.execute(r"INSERT INTO table (foo) VALUES ('\:colon_value')")


:param sqltext: Any legal SQLAlchemy expression, including:

* a string
* a :func:`sqlalchemy.sql.expression.text` construct.
* a :func:`sqlalchemy.sql.expression.insert` construct.
* a :func:`sqlalchemy.sql.expression.update` construct.
* a :func:`sqlalchemy.sql.expression.delete` construct.
* Any "executable" described in SQLAlchemy Core documentation,
  noting that no result set is returned.

.. note::  when passing a plain string, the statement is coerced into
   a :func:`sqlalchemy.sql.expression.text` construct. This construct
   considers symbols with colons, e.g. ``:foo`` to be bound parameters.
   To avoid this, ensure that colon symbols are escaped, e.g.
   ``\:foo``.

:param execution_options: Optional dictionary of
 execution options, will be passed to
 :meth:`sqlalchemy.engine.Connection.execution_options`.
NrX   rM   sqltextr7  s      rN   executeOperations.execute  s    l rQ   c                   g)a4  Emit an ALTER TABLE to rename a table.

:param old_table_name: old name.
:param new_table_name: new name.
:param schema: Optional schema name to operate within.  To control
 quoting of the schema outside of the default behavior, use
 the SQLAlchemy construct
 :class:`~sqlalchemy.sql.elements.quoted_name`.

NrX   )rM   old_table_namenew_table_namer   s       rN   rename_tableOperations.rename_table6      " rQ   rX   )r   r   r   Column[Any]r   r   r   r   )r   r   r   r   r   Optional[bool]r    Union[str, Literal[False], None]r   r   r   r   r   3Union[TypeEngine[Any], Type[TypeEngine[Any]], None]r   rF  r   *Union[str, bool, Identity, Computed, None]r   rD  r   r   r   r   r   r   r   r   )r   zUnion[Table, TableClause]r   zList[Dict[str, Any]]r   boolr   r   )r   r   r   r   r   +Union[str, ColumnElement[bool], TextClause]r   r   r   r   r   r   )
r   r   r   r   r   r   r   r   r   r   )r   r   r  r   r  r   r  	List[str]r  rJ  r  r   r  r   r  rD  r  r   r  r   r  r   r	  r   r  r   r   r   )r  r   r   r   r  z/Sequence[Union[str, TextClause, Function[Any]]]r   r   r  rH  r  rD  r   r   r   r   )
r   r   r   r   r  rJ  r   r   r   r   )
r   r   r  r,   r  rD  r   r   r   r"   )
r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r  Sequence[str]r   r   r   r   r   r   )
r   r   r   r   r   r   r   r   r   r   r   )
r   r   r   r   r   r   r   r   r   r   )r  r   r   r   r   r   r+  rD  r   r   r   r   )
r   r   r   r   r+  rD  r   r   r   r   )r   r   r   r   r   r   r   r   r:  zUnion[Executable, str]r7  zOptional[dict[str, Any]]r   r   )r>  r   r?  r   r   r   r   r   )rl   r   r   r   rs   r   r   r   r   r   r  r  r  r  r  r   r#  r&  r)  r-  r1  r4  r;  r@  r   rX   rQ   rN   r@   r@   E  su   :  %)T	T	  T	
 "T	 T	v (,8="'-1IM  04.2$(%g	g	 g	
 %g	 6g	  g	 +g	 Gg	g	&g	   .!g	" ,#g	$ "%g	& 'g	( )g	\ !%f	,f	 'f	
 f	 f	\ %)1	*1	 1	 C	1	 "1	 1	 1	f)	 )	 )	 	)	
 )	 )	f '+&*)-'+#'+/-1B	*B	 B	  	B	
 "B	 #B	 $B	 $B	 'B	 %B	 !B	 )B	 +B	 B	  !B	T %) ,0:	%:	 :	 E	:	 ":	 :	 *:	 :	 :	D %)*	**	 *	 	*	 "*	 *	` -1	X	X	 !X	 *	X	
 X	 X	~ /3$(		 #	
 ,	 "	 	B %).	*.	 .	 #	.	 ".	 .	 .	j %),	,	 ,	
 ",	 ,	 ,	d $(		 %)	 	 	 !		 "	 	2 )-$	
 %)(,$	$	 &$	
 "$	 &$	 $	 $	T %)(,		 "		
 &	 	 	F /3$(		 ,		
 "	 	6 ;?	V	+V	  8	V	
 V	z %)		  	
 "	 	 	g rQ   r@   c                     \ rS rSr% SrS\S'   SS jr\(       a  SSS.       SS jjrSS	S	SSSS	SSSSS
.                           SS jjr	        SS jr
        S S jrSSSSSSS.                       S!S jjr        S"S jr      S#S jrSS.     S$S jjr        S%S jrS&S jr S'     S(S jjrS)S jrSS.   S*S jjrSS.     S+S jjrSrgSrg),rA   iL  a  Modifies the interface :class:`.Operations` for batch mode.

This basically omits the ``table_name`` and ``schema`` parameters
from associated methods, as these are a given when running under batch
mode.

.. seealso::

    :meth:`.Operations.batch_alter_table`

Note that as of 0.8, most of the methods on this class are produced
dynamically using the :meth:`.Operations.register_operation`
method.

r.   rH   c                    [        SU-  5      e)Nz>The %s method does not apply to a batch table alter operation.)r   r   s     rN   _noopBatchOperations._noop_  s    !L
 	
rQ   N)insert_beforeinsert_afterc                   g)zIssue an "add column" instruction using the current
batch migration context.

.. seealso::

    :meth:`.Operations.add_column`

NrX   )rM   r   rQ  rR  s       rN   r   BatchOperations.add_columnj  s     rQ   F)r   r   r   r   r   r   r   r   r   rQ  rR  c                   g)a  Issue an "alter column" instruction using the current
batch migration context.

Parameters are the same as that of :meth:`.Operations.alter_column`,
as well as the following option(s):

:param insert_before: String name of an existing column which this
 column should be placed before, when creating the new table.

:param insert_after: String name of an existing column which this
 column should be placed after, when creating the new table.  If
 both :paramref:`.BatchOperations.alter_column.insert_before`
 and :paramref:`.BatchOperations.alter_column.insert_after` are
 omitted, the column is inserted after the last existing column
 in the table.

.. seealso::

    :meth:`.Operations.alter_column`


NrX   )rM   r   r   r   r   r   r   r   r   r   r   rQ  rR  r   s                 rN   r   BatchOperations.alter_column{  s    V rQ   c                    g)zIssue a "create check constraint" instruction using the
current batch migration context.

The batch form of this call omits the ``source`` and ``schema``
arguments from the call.

.. seealso::

    :meth:`.Operations.create_check_constraint`

NrX   )rM   r   r   r   s       rN   r   'BatchOperations.create_check_constraint  rB  rQ   c                    g)a  Issue a "create exclude constraint" instruction using the
current batch migration context.

.. note::  This method is Postgresql specific, and additionally
   requires at least SQLAlchemy 1.0.

.. seealso::

    :meth:`.Operations.create_exclude_constraint`

NrX   )rM   r   r   r   s       rN   r  )BatchOperations.create_exclude_constraint       rQ   )r	  r  r  r  r  r  c                   g)a  Issue a "create foreign key" instruction using the
current batch migration context.

The batch form of this call omits the ``source`` and ``source_schema``
arguments from the call.

e.g.::

    with batch_alter_table("address") as batch_op:
        batch_op.create_foreign_key(
            "fk_user_address",
            "user",
            ["user_id"],
            ["id"],
        )

.. seealso::

    :meth:`.Operations.create_foreign_key`

NrX   )rM   r   r  r  r  r	  r  r  r  r  r  r  s               rN   r  "BatchOperations.create_foreign_key  r/  rQ   c                    g)zIssue a "create index" instruction using the
current batch migration context.

.. seealso::

    :meth:`.Operations.create_index`

NrX   )rM   r  r  r   s       rN   r  BatchOperations.create_index       rQ   c                    g)zIssue a "create primary key" instruction using the
current batch migration context.

The batch form of this call omits the ``table_name`` and ``schema``
arguments from the call.

.. seealso::

    :meth:`.Operations.create_primary_key`

NrX   )rM   r   r  s      rN   r  "BatchOperations.create_primary_key  r[  rQ   )r   c                   g)a  Emit a COMMENT ON operation to set the comment for a table
using the current batch migration context.

:param comment: string value of the comment being registered against
 the specified table.
:param existing_comment: String value of a comment
 already registered on the specified table, used within autogenerate
 so that the operation is reversible, but not required for direct
 use.

NrX   )rM   r   r   s      rN   r   $BatchOperations.create_table_comment  rB  rQ   c                    g)zIssue a "create unique constraint" instruction using the
current batch migration context.

The batch form of this call omits the ``source`` and ``schema``
arguments from the call.

.. seealso::

    :meth:`.Operations.create_unique_constraint`

NrX   )rM   r   r  r   s       rN   r#  (BatchOperations.create_unique_constraint!  r[  rQ   c                    g)zIssue a "drop column" instruction using the current
batch migration context.

.. seealso::

    :meth:`.Operations.drop_column`

NrX   )rM   r   r   s      rN   r&  BatchOperations.drop_column1       rQ   c                    g)zIssue a "drop constraint" instruction using the
current batch migration context.

The batch form of this call omits the ``table_name`` and ``schema``
arguments from the call.

.. seealso::

    :meth:`.Operations.drop_constraint`

NrX   )rM   r   r   s      rN   r)  BatchOperations.drop_constraint<  r[  rQ   c                    g)zIssue a "drop index" instruction using the
current batch migration context.

.. seealso::

    :meth:`.Operations.drop_index`

NrX   )rM   r  r   s      rN   r-  BatchOperations.drop_indexL  ri  rQ   c                   g)zIssue a "drop table comment" operation to
remove an existing comment set on a table using the current
batch operations context.

:param existing_comment: An optional string value of a comment already
 registered on the specified table.

NrX   )rM   r   s     rN   r4  "BatchOperations.drop_table_commentW  r`  rQ   r6  c                   g)zkExecute the given SQL using the current migration context.

.. seealso::

    :meth:`.Operations.execute`

NrX   r9  s      rN   r;  BatchOperations.executed  s     rQ   rX   )r   r   r   r   )r   rC  rQ  r   rR  r   r   r   )r   r   r   rD  r   rE  r   r   r   r   r   rF  r   rF  r   rG  r   rD  r   r   rQ  r   rR  r   r   r   r   r   )r   r   r   rI  r   r   r   r   )r   r   r   r   r   r   r   r   )r   r   r  r   r  rJ  r  rJ  r	  r   r  r   r  r   r  rD  r  r   r  r   r  r   r   r   )r  r   r  rJ  r   r   r   r   )r   r   r  rJ  r   r   )r   r   r   r   r   r   )r   r   r  rK  r   r   r   r   )r   r   r   r   r   r   r   )r   r   r   r   r   r   )r  r   r   r   r   r   )r   r   r   r   rL  )rl   r   r   r   rs   r   rO  r   r   r   r   r  r  r  r  r   r#  r&  r)  r-  r4  r;  r   rX   rQ   rN   rA   rA   L  s     
  ,0*.		 )		
 (	 	* (,8="'-1IM  04.2+/*.%+	+	 %	+	
 6+	  +	 ++	 G+	+	&+	  .+	  ,!+	" )#+	$ (%+	& '+	( )+	Z	 	 C	 		
 	&	#&	36	>A		. .2&*&*)-'+#'$	*$	  $	 "	$	
 #$	 +$	 $$	 $$	 '$	 %$	 !$	 $	 $	L	!	,5	=@			#0	;D		( /3		"	 ,		
 	&	#&	1>	FI		 		 @D	#&	/<		 		 8<	'4		" ;?		+	  8		
 	 	 rQ   rA   )T
__future__r   
contextlibr   ro   rq   typingr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   sqlalchemy.sql.elementsr    r   r   r   r   util.compatr   r   r   util.sqla_compatr    r!   
sqlalchemyr"   sqlalchemy.enginer#   sqlalchemy.sqlr$   sqlalchemy.sql.expressionr%   r&   r'   sqlalchemy.sql.functionsr(   sqlalchemy.sql.schemar)   r*   r+   r,   sqlalchemy.typesr-   r.   opsr/   r0   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r<   r=   ddlr>   runtime.migrationr?   __all__rB   rC   ModuleClsProxyrF   r@   rA   rX   rQ   rN   <module>r     s   # % 	                   (     1 / 0 1  ,)7541,..0+* $"!!")"!% ' !%!4
+T]T#s(+,uH,, uHpB# BN e( erQ   