MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / __init__

Method __init__

lib/sqlalchemy/sql/schema.py:4982–5132  ·  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[_DDLColumnReferenceArgument],
        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

4980 __visit_name__ = "foreign_key_constraint"
4981
4982 def __init__(
4983 self,
4984 columns: _typing_Sequence[_DDLColumnArgument],
4985 refcolumns: _typing_Sequence[_DDLColumnReferenceArgument],
4986 name: _ConstraintNameArgument = None,
4987 onupdate: Optional[str] = None,
4988 ondelete: Optional[str] = None,
4989 deferrable: Optional[bool] = None,
4990 initially: Optional[str] = None,
4991 use_alter: bool = False,
4992 link_to_name: bool = False,
4993 match: Optional[str] = None,
4994 table: Optional[Table] = None,
4995 info: Optional[_InfoType] = None,
4996 comment: Optional[str] = None,
4997 **dialect_kw: Any,
4998 ) -> None:
4999 r"""Construct a composite-capable FOREIGN KEY.
5000
5001 :param columns: A sequence of local column names. The named columns
5002 must be defined and present in the parent Table. The names should
5003 match the ``key`` given to each column (defaults to the name) unless
5004 ``link_to_name`` is True.
5005
5006 :param refcolumns: A sequence of foreign column names or Column
5007 objects. The columns must all be located within the same Table.
5008
5009 :param name: Optional, the in-database name of the key.
5010
5011 :param onupdate: Optional string. If set, emit ON UPDATE <value> when
5012 issuing DDL for this constraint. Typical values include CASCADE,
5013 DELETE and RESTRICT.
5014
5015 .. seealso::
5016
5017 :ref:`on_update_on_delete`
5018
5019 :param ondelete: Optional string. If set, emit ON DELETE <value> when
5020 issuing DDL for this constraint. Typical values include CASCADE,
5021 SET NULL and RESTRICT. Some dialects may allow for additional
5022 syntaxes.
5023
5024 .. seealso::
5025
5026 :ref:`on_update_on_delete`
5027
5028 :param deferrable: Optional bool. If set, emit DEFERRABLE or NOT
5029 DEFERRABLE when issuing DDL for this constraint.
5030
5031 :param initially: Optional string. If set, emit INITIALLY <value> when
5032 issuing DDL for this constraint.
5033
5034 :param link_to_name: if True, the string name given in ``column`` is
5035 the rendered name of the referenced column, not its locally assigned
5036 ``key``.
5037
5038 :param use_alter: If True, do not emit the DDL for this constraint as
5039 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