class ExcludeConstraint(ColumnCollectionConstraint):
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 |
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 | |
*elements | A 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. |
**kw | Undocumented |
name | Optional, the in-database name of this constraint. |
deferrable | Optional bool. If set, emit DEFERRABLE or NOT DEFERRABLE when issuing DDL for this constraint. |
initially | Optional string. If set, emit INITIALLY <value> when issuing DDL for this constraint. |
using | Optional string. If set, emit USING <index_method> when issuing DDL for this constraint. Defaults to 'gist'. |
where | Optional 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
New in version 1.3.21.
See Also :ref:`postgresql_operator_classes` - general description of how PostgreSQL operator classes are specified. |