class documentation

A table-level SQL constraint. :class:`_schema.Constraint` serves as the base class for the series of constraint objects that can be associated with :class:`_schema.Table` objects, including :class:`_schema.PrimaryKeyConstraint`, :class:`_schema.ForeignKeyConstraint` :class:`_schema.UniqueConstraint`, and :class:`_schema.CheckConstraint`.

Method __init__ Create a SQL constraint.
Method copy Undocumented
Class Variable __visit_name__ Undocumented
Instance Variable comment Undocumented
Instance Variable deferrable Undocumented
Instance Variable info Info dictionary associated with the object, allowing user-defined data to be associated with this :class:`.SchemaItem`.
Instance Variable initially Undocumented
Instance Variable name Undocumented
Instance Variable parent Undocumented
Property table Undocumented
Method _copy Undocumented
Method _set_parent Associate with this SchemaEvent's parent object.
Method _should_create_for_compiler Undocumented
Class Variable _column_flag Undocumented
Class Variable _creation_order Undocumented
Instance Variable _create_rule Undocumented
Instance Variable _type_bound Undocumented

Inherited from DialectKWArgs:

Class Method argument_for Add a new kind of dialect-specific keyword argument for this class.
Class Variable __slots__ Undocumented
Property dialect_kwargs A collection of keyword arguments specified as dialect-specific options to this construct.
Property dialect_options A collection of keyword arguments specified as dialect-specific options to this construct.
Property kwargs A synonym for :attr:`.DialectKWArgs.dialect_kwargs`.
Method _kw_reg_for_dialect_cls Undocumented
Method _validate_dialect_kwargs Undocumented
Class Variable _dialect_kwargs_traverse_internals Undocumented
Class Variable _kw_registry Undocumented

Inherited from HasConditionalDDL (via DialectKWArgs):

Method ddl_if apply a conditional DDL rule to this schema item.
Instance Variable _ddl_if Undocumented

Inherited from SchemaItem (via DialectKWArgs, HasConditionalDDL):

Method __repr__ Undocumented
Class Variable create_drop_stringify_dialect Undocumented
Method _init_items Initialize the list of child items for this SchemaItem.
Method _schema_item_copy Undocumented
Class Variable _use_schema_map Undocumented

Inherited from SchemaEventTarget (via DialectKWArgs, HasConditionalDDL, SchemaItem):

Class Variable dispatch Undocumented
Method _set_parent_with_dispatch Undocumented

Inherited from Visitable (via DialectKWArgs, HasConditionalDDL, SchemaItem, SchemaEventTarget, EventTarget):

Method __class_getitem__ Undocumented
Method __init_subclass__ Undocumented
Class Method _generate_compiler_dispatch Undocumented
Method _compiler_dispatch Undocumented
Class Variable _original_compiler_dispatch Undocumented
def __init__(self, name: _ConstraintNameArgument = None, deferrable: Optional[bool] = None, initially: Optional[str] = None, info: Optional[_InfoType] = None, comment: Optional[str] = None, _create_rule: Optional[Any] = None, _type_bound: bool = False, **dialect_kw: Any): (source)

Create a SQL constraint. :param name: Optional, the in-database name of this ``Constraint``. :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 info: Optional data dictionary which will be populated into the :attr:`.SchemaItem.info` attribute of this object. .. versionadded:: 1.0.0 :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>``. See the documentation regarding an individual dialect at :ref:`dialect_toplevel` for detail on documented arguments. :param _create_rule: used internally by some datatypes that also create constraints. :param _type_bound: used internally to indicate that this constraint is associated with a specific datatype.

@util.deprecated('1.4', 'The :meth:`_schema.Constraint.copy` method is deprecated and will be removed in a future release.')
def copy(self, **kw: Any) -> Self: (source)

Undocumented

deferrable = (source)

Undocumented

Info dictionary associated with the object, allowing user-defined data to be associated with this :class:`.SchemaItem`. The dictionary is automatically generated when first accessed. It can also be specified in the constructor of some objects, such as :class:`_schema.Table` and :class:`_schema.Column`.

initially = (source)

Undocumented

Undocumented

Undocumented

Undocumented

def _copy(self, **kw: Any) -> Self: (source)
def _set_parent(self, parent: SchemaEventTarget, **kw: Any): (source)

Associate with this SchemaEvent's parent object.

def _should_create_for_compiler(self, compiler: DDLCompiler, **kw: Any) -> bool: (source)

Undocumented

_column_flag: bool = (source)

Undocumented

_creation_order: int = (source)

Undocumented

_create_rule = (source)

Undocumented

_type_bound = (source)

Undocumented