Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Machine Learning
avec Scikit-Learn
Voir le programme détaillé
Classe « ForeignKey »

Constructeur sqlalchemy.ForeignKey.__init__

Signature de la constructeur __init__

def __init__(self, column: '_DDLColumnArgument', _constraint: 'Optional[ForeignKeyConstraint]' = None, use_alter: 'bool' = False, name: '_ConstraintNameArgument' = None, onupdate: 'Optional[str]' = None, ondelete: 'Optional[str]' = None, deferrable: 'Optional[bool]' = None, initially: 'Optional[str]' = None, link_to_name: 'bool' = False, match: 'Optional[str]' = None, info: 'Optional[_InfoType]' = None, comment: 'Optional[str]' = None, _unresolvable: 'bool' = False, **dialect_kw: 'Any') 

Description

help(ForeignKey.__init__)

Construct a column-level FOREIGN KEY.

The :class:`_schema.ForeignKey` object when constructed generates a
:class:`_schema.ForeignKeyConstraint`
which is associated with the parent
:class:`_schema.Table` object's collection of constraints.

:param column: A single target column for the key relationship. A
    :class:`_schema.Column` object or a column name as a string:
    ``tablename.columnkey`` or ``schema.tablename.columnkey``.
    ``columnkey`` is the ``key`` which has been assigned to the column
    (defaults to the column name itself), unless ``link_to_name`` is
    ``True`` in which case the rendered name of the column is used.

:param name: Optional string. An in-database name for the key if
    `constraint` is not provided.

:param onupdate: Optional string. If set, emit ON UPDATE <value> when
    issuing DDL for this constraint. Typical values include CASCADE,
    DELETE and RESTRICT.

:param ondelete: Optional string. If set, emit ON DELETE <value> when
    issuing DDL for this constraint. Typical values include CASCADE,
    DELETE and RESTRICT.

:param deferrable: Optional bool. If set, emit DEFERRABLE or NOT
    DEFERRABLE when issuing DDL for this constraint.

:param initially: Optional string. If set, emit INITIALLY <value> when
    issuing DDL for this constraint.

:param link_to_name: if True, the string name given in ``column`` is
    the rendered name of the referenced column, not its locally
    assigned ``key``.

:param use_alter: passed to the underlying
    :class:`_schema.ForeignKeyConstraint`
    to indicate the constraint should
    be generated/dropped externally from the CREATE TABLE/ DROP TABLE
    statement.  See :paramref:`_schema.ForeignKeyConstraint.use_alter`
    for further description.

    .. seealso::

        :paramref:`_schema.ForeignKeyConstraint.use_alter`

        :ref:`use_alter`

:param match: Optional string. If set, emit MATCH <value> when issuing
    DDL for this constraint. Typical values include SIMPLE, PARTIAL
    and FULL.

:param info: Optional data dictionary which will be populated into the
    :attr:`.SchemaItem.info` attribute of this object.

:param comment: Optional string that will render an SQL comment on
  foreign key constraint creation.

    .. versionadded:: 2.0

:param \**dialect_kw:  Additional keyword arguments are dialect
    specific, and passed in the form ``<dialectname>_<argname>``.  The
    arguments are ultimately handled by a corresponding
    :class:`_schema.ForeignKeyConstraint`.
    See the documentation regarding
    an individual dialect at :ref:`dialect_toplevel` for detail on
    documented arguments.



Vous êtes un professionnel et vous avez besoin d'une formation ? Calcul scientifique
avec Python
Voir le programme détaillé