class documentation

class CheckConstraint(ColumnCollectionConstraint):

View In Hierarchy

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
Method copy Undocumented
Class Variable __visit​_name__ Undocumented
Class Variable ​_allow​_multiple​_tables Undocumented
Instance Variable sqltext Undocumented
Property is​_column​_level Undocumented

Inherited from ColumnCollectionConstraint:

Method __contains__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Method ​_set​_parent Associate with this SchemaEvent's parent object.
Method contains​_column Return True if this constraint contains the given column.
Class Variable columns A _expression.ColumnCollection representing the set of columns for this constraint.

Inherited from ColumnCollectionMixin (via ColumnCollectionConstraint):

Method ​_check​_attach Undocumented
Method ​_col​_expressions Undocumented
Instance Variable ​_cols​_wo​_table Undocumented
Instance Variable ​_column​_flag Undocumented
Instance Variable ​_pending​_colargs Undocumented

Inherited from Constraint (via ColumnCollectionConstraint):

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 (via ColumnCollectionConstraint, Constraint):

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 (via ColumnCollectionConstraint, Constraint):

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 ColumnCollectionConstraint, Constraint, SchemaItem):

Method ​_set​_parent​_with​_dispatch Undocumented

Inherited from Traversible (via ColumnCollectionConstraint, Constraint, SchemaItem):

Method get​_children Return immediate child .visitors.Traversible elements of this .visitors.Traversible.
Method __class​_getitem__ Undocumented
@_document_text_coercion('sqltext', ':class:`.CheckConstraint`', ':paramref:`.CheckConstraint.sqltext`')
def __init__(self, sqltext, name=None, deferrable=None, initially=None, table=None, info=None, _create_rule=None, _autoattach=True, _type_bound=False, **kw):
Construct a CHECK constraint.
Parameters
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 _expression.text object. If the textual string includes a colon character, escape this using a backslash:

CheckConstraint(r"foo ~ E'a(?\:b|c)d")
nameOptional, the in-database name of the 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.
tableUndocumented
info

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

New in version 1.0.0.
​_create​_ruleUndocumented
​_autoattachUndocumented
​_type​_boundUndocumented
**kwUndocumented
def _copy(self, target_table=None, **kw):
@util.deprecated('1.4', 'The :meth:`_schema.CheckConstraint.copy` method is deprecated and will be removed in a future release.')
def copy(self, target_table=None, **kw):
__visit_name__: str =
_allow_multiple_tables: bool =
sqltext =

Undocumented

@property
is_column_level =

Undocumented