MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/sql/schema.py:4602–4752  ·  view source on GitHub ↗

r"""Construct a composite-capable FOREIGN KEY. :param columns: A sequence of local column names. The named columns must be defined and present in the parent Table. The names should match the ``key`` given to each column (defaults to the name) unless ``link_to_n

(
        self,
        columns: _typing_Sequence[_DDLColumnArgument],
        refcolumns: _typing_Sequence[_DDLColumnArgument],
        name: _ConstraintNameArgument = None,
        onupdate: Optional[str] = None,
        ondelete: Optional[str] = None,
        deferrable: Optional[bool] = None,
        initially: Optional[str] = None,
        use_alter: bool = False,
        link_to_name: bool = False,
        match: Optional[str] = None,
        table: Optional[Table] = None,
        info: Optional[_InfoType] = None,
        comment: Optional[str] = None,
        **dialect_kw: Any,
    )

Source from the content-addressed store, hash-verified

4600 __visit_name__ = "foreign_key_constraint"
4601
4602 def __init__(
4603 self,
4604 columns: _typing_Sequence[_DDLColumnArgument],
4605 refcolumns: _typing_Sequence[_DDLColumnArgument],
4606 name: _ConstraintNameArgument = None,
4607 onupdate: Optional[str] = None,
4608 ondelete: Optional[str] = None,
4609 deferrable: Optional[bool] = None,
4610 initially: Optional[str] = None,
4611 use_alter: bool = False,
4612 link_to_name: bool = False,
4613 match: Optional[str] = None,
4614 table: Optional[Table] = None,
4615 info: Optional[_InfoType] = None,
4616 comment: Optional[str] = None,
4617 **dialect_kw: Any,
4618 ) -> None:
4619 r"""Construct a composite-capable FOREIGN KEY.
4620
4621 :param columns: A sequence of local column names. The named columns
4622 must be defined and present in the parent Table. The names should
4623 match the ``key`` given to each column (defaults to the name) unless
4624 ``link_to_name`` is True.
4625
4626 :param refcolumns: A sequence of foreign column names or Column
4627 objects. The columns must all be located within the same Table.
4628
4629 :param name: Optional, the in-database name of the key.
4630
4631 :param onupdate: Optional string. If set, emit ON UPDATE <value> when
4632 issuing DDL for this constraint. Typical values include CASCADE,
4633 DELETE and RESTRICT.
4634
4635 .. seealso::
4636
4637 :ref:`on_update_on_delete`
4638
4639 :param ondelete: Optional string. If set, emit ON DELETE <value> when
4640 issuing DDL for this constraint. Typical values include CASCADE,
4641 SET NULL and RESTRICT. Some dialects may allow for additional
4642 syntaxes.
4643
4644 .. seealso::
4645
4646 :ref:`on_update_on_delete`
4647
4648 :param deferrable: Optional bool. If set, emit DEFERRABLE or NOT
4649 DEFERRABLE when issuing DDL for this constraint.
4650
4651 :param initially: Optional string. If set, emit INITIALLY <value> when
4652 issuing DDL for this constraint.
4653
4654 :param link_to_name: if True, the string name given in ``column`` is
4655 the rendered name of the referenced column, not its locally assigned
4656 ``key``.
4657
4658 :param use_alter: If True, do not emit the DDL for this constraint as
4659 part of the CREATE TABLE definition. Instead, generate it via an

Callers

nothing calls this directly

Calls 3

ForeignKeyClass · 0.85
__init__Method · 0.45

Tested by

no test coverage detected