def bulk_insert(
table: Union[Table, TableClause],
rows: List[dict],
+ *,
multiinsert: bool = True,
) -> None:
"""Issue a "bulk insert" operation using the current
def create_table_comment(
table_name: str,
comment: Optional[str],
- existing_comment: Optional[str] = None,
*,
+ existing_comment: Optional[str] = None,
schema: Optional[str] = None,
) -> None:
"""Emit a COMMENT ON operation to set the comment for a table.
def execute(
sqltext: Union[str, TextClause, Update],
+ *,
execution_options: Optional[dict[str, Any]] = None,
) -> None:
r"""Execute the given SQL using the current migration context.
self,
table: Union[Table, TableClause],
rows: List[dict],
+ *,
multiinsert: bool = True,
) -> None:
"""Issue a "bulk insert" operation using the current
self,
table_name: str,
comment: Optional[str],
- existing_comment: Optional[str] = None,
*,
+ existing_comment: Optional[str] = None,
schema: Optional[str] = None,
) -> None:
"""Emit a COMMENT ON operation to set the comment for a table.
def execute(
self,
sqltext: Union[str, TextClause, Update],
+ *,
execution_options: Optional[dict[str, Any]] = None,
) -> None:
r"""Execute the given SQL using the current migration context.
def create_table_comment(
self,
comment: Optional[str],
+ *,
existing_comment: Optional[str] = None,
) -> None:
"""Emit a COMMENT ON operation to set the comment for a table
...
def drop_table_comment(
- self, existing_comment: Optional[str] = None
+ self, *, existing_comment: Optional[str] = None
) -> None:
"""Issue a "drop table comment" operation to
remove an existing comment set on a table using the current
""" # noqa: E501
...
+ def execute(
+ self,
+ sqltext: Union[str, TextClause, Update],
+ *,
+ execution_options: Optional[dict[str, Any]] = None,
+ ) -> None:
+ """Execute the given SQL using the current migration context.
+
+ .. seealso::
+
+ :meth:`.Operations.execute`
+
+ """ # noqa: E501
+ ...
+
# END STUB FUNCTIONS: batch_op
_reverse=AddConstraintOp.from_constraint(constraint),
)
- def to_constraint(
- self,
- ) -> Constraint:
+ def to_constraint(self) -> Constraint:
if self._reverse is not None:
constraint = self._reverse.to_constraint()
operations: Operations,
table_name: str,
comment: Optional[str],
- existing_comment: Optional[str] = None,
*,
+ existing_comment: Optional[str] = None,
schema: Optional[str] = None,
) -> None:
"""Emit a COMMENT ON operation to set the comment for a table.
cls,
operations: BatchOperations,
comment: Optional[str],
+ *,
existing_comment: Optional[str] = None,
) -> None:
"""Emit a COMMENT ON operation to set the comment for a table
def batch_drop_table_comment(
cls,
operations: BatchOperations,
+ *,
existing_comment: Optional[str] = None,
) -> None:
"""Issue a "drop table comment" operation to
self,
table: Union[Table, TableClause],
rows: List[dict],
+ *,
multiinsert: bool = True,
) -> None:
self.table = table
operations: Operations,
table: Union[Table, TableClause],
rows: List[dict],
+ *,
multiinsert: bool = True,
) -> None:
"""Issue a "bulk insert" operation using the current
@Operations.register_operation("execute")
-@BatchOperations.register_operation("execute")
+@BatchOperations.register_operation("execute", "batch_execute")
class ExecuteSQLOp(MigrateOperation):
"""Represent an execute SQL operation."""
def __init__(
self,
sqltext: Union[Update, str, Insert, TextClause],
+ *,
execution_options: Optional[dict[str, Any]] = None,
) -> None:
self.sqltext = sqltext
cls,
operations: Operations,
sqltext: Union[str, TextClause, Update],
+ *,
execution_options: Optional[dict[str, Any]] = None,
) -> None:
r"""Execute the given SQL using the current migration context.
op = cls(sqltext, execution_options=execution_options)
return operations.invoke(op)
+ @classmethod
+ def batch_execute(
+ cls,
+ operations: Operations,
+ sqltext: Union[str, TextClause, Update],
+ *,
+ execution_options: Optional[dict[str, Any]] = None,
+ ) -> None:
+ """Execute the given SQL using the current migration context.
+
+ .. seealso::
+
+ :meth:`.Operations.execute`
+
+ """
+ return cls.execute(
+ operations, sqltext, execution_options=execution_options
+ )
+
class OpContainer(MigrateOperation):
"""Represent a sequence of operations operation."""