class Constraint(DialectKWArgs, HasConditionalDDL, SchemaItem): (source)
Known subclasses: sqlalchemy.sql.schema.ColumnCollectionConstraint
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 |
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 |
Associate with this SchemaEvent's parent object. |
Method | _should |
Undocumented |
Class Variable | _column |
Undocumented |
Class Variable | _creation |
Undocumented |
Instance Variable | _create |
Undocumented |
Instance Variable | _type |
Undocumented |
Inherited from DialectKWArgs
:
Class Method | argument |
Add a new kind of dialect-specific keyword argument for this class. |
Class Variable | __slots__ |
Undocumented |
Property | dialect |
A collection of keyword arguments specified as dialect-specific options to this construct. |
Property | dialect |
A collection of keyword arguments specified as dialect-specific options to this construct. |
Property | kwargs |
A synonym for :attr:`.DialectKWArgs.dialect_kwargs`. |
Method | _kw |
Undocumented |
Method | _validate |
Undocumented |
Class Variable | _dialect |
Undocumented |
Class Variable | _kw |
Undocumented |
Inherited from HasConditionalDDL
(via DialectKWArgs
):
Method | ddl |
apply a conditional DDL rule to this schema item. |
Instance Variable | _ddl |
Undocumented |
Inherited from SchemaItem
(via DialectKWArgs
, HasConditionalDDL
):
Method | __repr__ |
Undocumented |
Class Variable | create |
Undocumented |
Method | _init |
Initialize the list of child items for this SchemaItem. |
Method | _schema |
Undocumented |
Class Variable | _use |
Undocumented |
Inherited from SchemaEventTarget
(via DialectKWArgs
, HasConditionalDDL
, SchemaItem
):
Class Variable | dispatch |
Undocumented |
Method | _set |
Undocumented |
Inherited from Visitable
(via DialectKWArgs
, HasConditionalDDL
, SchemaItem
, SchemaEventTarget
, EventTarget
):
Method | __class |
Undocumented |
Method | __init |
Undocumented |
Class Method | _generate |
Undocumented |
Method | _compiler |
Undocumented |
Class Variable | _original |
Undocumented |
_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)
¶
sqlalchemy.sql.schema.ColumnCollectionConstraint
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.
def copy(self, **kw:
Any
) -> Self
:
(source)
¶
sqlalchemy.sql.schema.ColumnCollectionConstraint
Undocumented
sqlalchemy.sql.schema.SchemaItem.info
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`.
sqlalchemy.sql.schema.ColumnCollectionConstraint
Associate with this SchemaEvent's parent object.