class ExcludeConstraint(ColumnCollectionConstraint): (source)
A table-level EXCLUDE constraint. Defines an EXCLUDE constraint as described in the `PostgreSQL documentation`__. __ https://www.postgresql.org/docs/current/static/sql-createtable.html#SQL-CREATETABLE-EXCLUDE
Method | __init__ |
Create an :class:`.ExcludeConstraint` object. |
Class Variable | __visit |
Undocumented |
Class Variable | create |
Undocumented |
Class Variable | inherit |
Undocumented |
Instance Variable | operators |
Undocumented |
Instance Variable | ops |
Undocumented |
Instance Variable | using |
Undocumented |
Instance Variable | where |
Undocumented |
Method | _copy |
Undocumented |
Method | _set |
Associate with this SchemaEvent's parent object. |
Instance Variable | _render |
Undocumented |
Inherited from ColumnCollectionConstraint
:
Method | __contains__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | contains |
Return True if this constraint contains the given column. |
Method | copy |
Undocumented |
Class Variable | columns |
A :class:`_expression.ColumnCollection` representing the set of columns for this constraint. |
Inherited from ColumnCollectionMixin
(via ColumnCollectionConstraint
):
Property | c |
Undocumented |
Method | _check |
Undocumented |
Method | _col |
Undocumented |
Method | _set |
Undocumented |
Class Variable | _allow |
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 |
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, *elements, **kw): (source) ¶
Create an :class:`.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 :class:`_schema.Table` construct directly, or added later using :meth:`.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'} ) ) :param \*elements: A sequence of two tuples of the form ``(column, operator)`` where "column" is either a :class:`_schema.Column` object, or a SQL expression element (e.g. ``func.int8range(table.from, table.to)``) or the name of a column as string, and "operator" is a string containing the operator to use (e.g. `"&&"` or `"="`). In order to specify a column name when a :class:`_schema.Column` object is not available, while ensuring that any necessary quoting rules take effect, an ad-hoc :class:`_schema.Column` or :func:`_expression.column` object should be used. The ``column`` may also be a string SQL expression when passed as :func:`_expression.literal_column` or :func:`_expression.text` :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 using: Optional string. If set, emit USING <index_method> when issuing DDL for this constraint. Defaults to 'gist'. :param where: Optional SQL expression construct or literal SQL string. If set, emit WHERE <predicate> when issuing DDL for this constraint. :param 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 :class:`_schema.Index` construct. .. versionadded:: 1.3.21 .. seealso:: :ref:`postgresql_operator_classes` - general description of how PostgreSQL operator classes are specified.