class documentation

class Constraint(DialectKWArgs, SchemaItem):

Known subclasses: sqlalchemy.sql.schema.ColumnCollectionConstraint

View In Hierarchy

A table-level SQL constraint.

_schema.Constraint serves as the base class for the series of constraint objects that can be associated with _schema.Table objects, including _schema.PrimaryKeyConstraint, _schema.ForeignKeyConstraint _schema.UniqueConstraint, and _schema.CheckConstraint.

Method __init__ Create a SQL constraint.
Method ​_copy Undocumented
Method ​_set​_parent Associate with this SchemaEvent's parent object.
Method copy Undocumented
Class Variable __visit​_name__ Undocumented
Instance Variable ​_create​_rule Undocumented
Instance Variable ​_type​_bound Undocumented
Instance Variable deferrable Undocumented
Instance Variable info Info dictionary associated with the object, allowing user-defined data to be associated with this .SchemaItem.
Instance Variable initially Undocumented
Instance Variable name Undocumented
Instance Variable parent Undocumented
Property table Undocumented

Inherited from DialectKWArgs:

Class Method argument​_for Add a new kind of dialect-specific keyword argument for this class.
Method ​_kw​_reg​_for​_dialect​_cls Undocumented
Method ​_validate​_dialect​_kwargs Undocumented
Class Variable ​_dialect​_kwargs​_traverse​_internals Undocumented
Class Variable ​_kw​_registry 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 .DialectKWArgs.dialect_kwargs.

Inherited from SchemaItem:

Method __repr__ Undocumented
Method ​_init​_items Initialize the list of child items for this SchemaItem.
Method ​_schema​_item​_copy Undocumented
Class Variable ​_use​_schema​_map Undocumented
Class Variable create​_drop​_stringify​_dialect Undocumented

Inherited from SchemaEventTarget (via SchemaItem):

Method ​_set​_parent​_with​_dispatch Undocumented

Inherited from Traversible (via SchemaItem):

Method get​_children Return immediate child .visitors.Traversible elements of this .visitors.Traversible.
Method __class​_getitem__ Undocumented
def __init__(self, name=None, deferrable=None, initially=None, _create_rule=None, info=None, _type_bound=False, **dialect_kw):
Create a SQL constraint.
Parameters
nameOptional, the in-database name of this Constraint.
deferrableOptional bool. If set, emit DEFERRABLE or NOT DEFERRABLE when issuing DDL for this constraint.
initiallyOptional string. If set, emit INITIALLY <value> when issuing DDL for this constraint.
​_create​_ruleused internally by some datatypes that also create constraints.
info

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

New in version 1.0.0.
​_type​_boundused internally to indicate that this constraint is associated with a specific datatype.
**dialect​_kwAdditional 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.
def _copy(self, **kw):
def _set_parent(self, parent, **kw):
Associate with this SchemaEvent's parent object.
@util.deprecated('1.4', 'The :meth:`_schema.Constraint.copy` method is deprecated and will be removed in a future release.')
def copy(self, **kw):
_create_rule =

Undocumented

_type_bound =

Undocumented

deferrable =

Undocumented

info =

Info dictionary associated with the object, allowing user-defined data to be associated with this .SchemaItem.

The dictionary is automatically generated when first accessed. It can also be specified in the constructor of some objects, such as _schema.Table and _schema.Column.

initially =

Undocumented

name =

Undocumented

parent =

Undocumented

@property
table =

Undocumented