Represent a CREATE TABLE statement.
| 512 | |
| 513 | |
| 514 | class CreateTable(_CreateBase["Table"]): |
| 515 | """Represent a CREATE TABLE statement.""" |
| 516 | |
| 517 | __visit_name__ = "create_table" |
| 518 | |
| 519 | def __init__( |
| 520 | self, |
| 521 | element: Table, |
| 522 | include_foreign_key_constraints: Optional[ |
| 523 | typing_Sequence[ForeignKeyConstraint] |
| 524 | ] = None, |
| 525 | if_not_exists: bool = False, |
| 526 | ) -> None: |
| 527 | """Create a :class:`.CreateTable` construct. |
| 528 | |
| 529 | :param element: a :class:`_schema.Table` that's the subject |
| 530 | of the CREATE |
| 531 | :param on: See the description for 'on' in :class:`.DDL`. |
| 532 | :param include_foreign_key_constraints: optional sequence of |
| 533 | :class:`_schema.ForeignKeyConstraint` objects that will be included |
| 534 | inline within the CREATE construct; if omitted, all foreign key |
| 535 | constraints that do not specify use_alter=True are included. |
| 536 | |
| 537 | :param if_not_exists: if True, an IF NOT EXISTS operator will be |
| 538 | applied to the construct. |
| 539 | |
| 540 | .. versionadded:: 1.4.0b2 |
| 541 | |
| 542 | """ |
| 543 | super().__init__(element, if_not_exists=if_not_exists) |
| 544 | self.columns = [CreateColumn(column) for column in element.columns] |
| 545 | self.include_foreign_key_constraints = include_foreign_key_constraints |
| 546 | |
| 547 | |
| 548 | class _DropView(_DropBase["Table"]): |
no outgoing calls