Insert a :class:`_schema.Column` to this :class:`_schema.Table` at a specific position. Behavior is identical to :meth:`.Table.append_column` except that the index position can be controlled using the :paramref:`.Table.insert_column.index` parameter.
(
self,
column: ColumnClause[Any],
index: int,
*,
replace_existing: bool = False,
)
| 1445 | ) from de |
| 1446 | |
| 1447 | def insert_column( |
| 1448 | self, |
| 1449 | column: ColumnClause[Any], |
| 1450 | index: int, |
| 1451 | *, |
| 1452 | replace_existing: bool = False, |
| 1453 | ) -> None: |
| 1454 | """Insert a :class:`_schema.Column` to this :class:`_schema.Table` at |
| 1455 | a specific position. |
| 1456 | |
| 1457 | Behavior is identical to :meth:`.Table.append_column` except that |
| 1458 | the index position can be controlled using the |
| 1459 | :paramref:`.Table.insert_column.index` |
| 1460 | parameter. |
| 1461 | |
| 1462 | :param replace_existing: |
| 1463 | see :paramref:`.Table.append_column.replace_existing` |
| 1464 | :param index: integer index to insert the new column. |
| 1465 | |
| 1466 | .. versionadded:: 2.1 |
| 1467 | |
| 1468 | """ |
| 1469 | self._insert_col_impl( |
| 1470 | column, index=index, replace_existing=replace_existing |
| 1471 | ) |
| 1472 | |
| 1473 | def append_column( |
| 1474 | self, column: ColumnClause[Any], *, replace_existing: bool = False |