class documentation

class ExcludeConstraint(ColumnCollectionConstraint):

View In Hierarchy

A table-level EXCLUDE constraint.

Defines an EXCLUDE constraint as described in the PostgreSQL documentation.

Method __init__ Create an .ExcludeConstraint object.
Method ​_copy Undocumented
Method ​_set​_parent Associate with this SchemaEvent's parent object.
Class Variable __visit​_name__ Undocumented
Class Variable create​_drop​_stringify​_dialect Undocumented
Class Variable inherit​_cache Undocumented
Instance Variable ​_render​_exprs Undocumented
Instance Variable operators Undocumented
Instance Variable ops Undocumented
Instance Variable using Undocumented
Instance Variable where Undocumented

Inherited from ColumnCollectionConstraint:

Method __contains__ Undocumented
Method __iter__ Undocumented
Method __len__ Undocumented
Method contains​_column Return True if this constraint contains the given column.
Method copy Undocumented
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
Class Variable ​_allow​_multiple​_tables 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

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
@elements._document_text_coercion('where', ':class:`.ExcludeConstraint`', ':paramref:`.ExcludeConstraint.where`')
def __init__(self, *elements, **kw):

Create an .ExcludeConstraint object.

E.g.:

const = ExcludeConstraint(
    (Column('period'), '&&'),
    (Column('group'), '='),
    where=(Column('group') != 'some group'),
    ops={'group': 'my_operator_class'}
)

The constraint is normally embedded into the _schema.Table construct directly, or added later using .append_constraint:

some_table = Table(
    'some_table', metadata,
    Column('id', Integer, primary_key=True),
    Column('period', TSRANGE()),
    Column('group', String)
)

some_table.append_constraint(
    ExcludeConstraint(
        (some_table.c.period, '&&'),
        (some_table.c.group, '='),
        where=some_table.c.group != 'some group',
        name='some_table_excl_const',
        ops={'group': 'my_operator_class'}
    )
)
Parameters
*elementsA sequence of two tuples of the form (column, operator) where "column" is a SQL expression element or a raw SQL string, most typically a _schema.Column object, and "operator" is a string containing the operator to use. In order to specify a column name when a _schema.Column object is not available, while ensuring that any necessary quoting rules take effect, an ad-hoc _schema.Column or _expression.column object should be used.
**kwUndocumented
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.
usingOptional string. If set, emit USING <index_method> when issuing DDL for this constraint. Defaults to 'gist'.
whereOptional SQL expression construct or literal SQL string. If set, emit WHERE <predicate> when issuing DDL for this constraint.
ops

Optional dictionary. Used to define operator classes for the elements; works the same way as that of the :ref:`postgresql_ops <postgresql_operator_classes>` parameter specified to the _schema.Index construct.

New in version 1.3.21.

See Also

:ref:`postgresql_operator_classes` - general description of how PostgreSQL operator classes are specified.

def _copy(self, target_table=None, **kw):
def _set_parent(self, table, **kw):
Associate with this SchemaEvent's parent object.
__visit_name__: str =
create_drop_stringify_dialect: str =
inherit_cache: bool =

Undocumented

_render_exprs =

Undocumented

operators: dict =

Undocumented

ops =

Undocumented

using =

Undocumented

where =

Undocumented