class CheckConstraint(ColumnCollectionConstraint): (source)
A table- or column-level CHECK constraint. Can be included in the definition of a Table or Column.
Method | __init__ |
Construct a CHECK constraint. |
Method | copy |
Undocumented |
Class Variable | __visit |
Undocumented |
Instance Variable | sqltext |
Undocumented |
Property | is |
Undocumented |
Method | _copy |
Undocumented |
Class Variable | _allow |
Undocumented |
Inherited from ColumnCollectionConstraint
:
Method | __contains__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | contains |
Return True if this constraint contains the given column. |
Class Variable | columns |
A :class:`_expression.ColumnCollection` representing the set of columns for this constraint. |
Method | _set |
Associate with this SchemaEvent's parent object. |
Inherited from ColumnCollectionMixin
(via ColumnCollectionConstraint
):
Property | c |
Undocumented |
Method | _check |
Undocumented |
Method | _col |
Undocumented |
Method | _set |
Undocumented |
Instance Variable | _cols |
Undocumented |
Instance Variable | _column |
Undocumented |
Instance Variable | _columns |
Undocumented |
Instance Variable | _pending |
Undocumented |
Inherited from Constraint
(via ColumnCollectionConstraint
, ColumnCollectionMixin
):
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 | _should |
Undocumented |
Class Variable | _creation |
Undocumented |
Instance Variable | _create |
Undocumented |
Instance Variable | _type |
Undocumented |
Inherited from DialectKWArgs
(via ColumnCollectionConstraint
, ColumnCollectionMixin
, Constraint
):
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 ColumnCollectionConstraint
, ColumnCollectionMixin
, Constraint
, DialectKWArgs
):
Method | ddl |
apply a conditional DDL rule to this schema item. |
Instance Variable | _ddl |
Undocumented |
Inherited from SchemaItem
(via ColumnCollectionConstraint
, ColumnCollectionMixin
, Constraint
, 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 ColumnCollectionConstraint
, ColumnCollectionMixin
, Constraint
, DialectKWArgs
, HasConditionalDDL
, SchemaItem
):
Class Variable | dispatch |
Undocumented |
Inherited from Visitable
(via ColumnCollectionConstraint
, ColumnCollectionMixin
, Constraint
, DialectKWArgs
, HasConditionalDDL
, SchemaItem
, SchemaEventTarget
, EventTarget
):
Method | __class |
Undocumented |
Method | __init |
Undocumented |
Class Method | _generate |
Undocumented |
Method | _compiler |
Undocumented |
Class Variable | _original |
Undocumented |
def __init__(self, sqltext:
_TextCoercedExpressionArgument[ Any]
, name: _ConstraintNameArgument
= None, deferrable: Optional[ bool]
= None, initially: Optional[ str]
= None, table: Optional[ Table]
= None, info: Optional[ _InfoType]
= None, _create_rule: Optional[ Any]
= None, _autoattach: bool
= True, _type_bound: bool
= False, **dialect_kw: Any
):
(source)
¶
Construct a CHECK constraint. :param sqltext: A string containing the constraint definition, which will be used verbatim, or a SQL expression construct. If given as a string, the object is converted to a :func:`_expression.text` object. If the textual string includes a colon character, escape this using a backslash:: CheckConstraint(r"foo ~ E'a(?\:b|c)d") :param name: Optional, the in-database name of the 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
def copy(self, *, target_table:
Optional[ Table]
= None, **kw: Any
) -> CheckConstraint
:
(source)
¶
Undocumented