class Any(expression.ColumnElement):
- """Return the clause ``left operator ANY (right)``. ``right`` must be
+ """Represent the clause ``left operator ANY (right)``. ``right`` must be
an array expression.
- See also:
+ .. seealso::
+
+ :class:`.postgresql.ARRAY`
+
+ :meth:`.postgresql.ARRAY.Comparator.any` - ARRAY-bound method
- :class:`.postgresql.ARRAY`
"""
__visit_name__ = 'any'
class All(expression.ColumnElement):
- """Return the clause ``left operator ALL (right)``. ``right`` must be
+ """Represent the clause ``left operator ALL (right)``. ``right`` must be
an array expression.
- See also:
+ .. seealso::
+
+ :class:`.postgresql.ARRAY`
+
+ :meth:`.postgresql.ARRAY.Comparator.all` - ARRAY-bound method
- :class:`.postgresql.ARRAY`
"""
__visit_name__ = 'all'
result_type=return_type)
def any(self, other, operator=operators.eq):
- """Return ``other operator ANY (array)`` clause. Argument places
- are switched, because ANY requires array expression to be on the
- right hand-side.
+ """Return ``other operator ANY (array)`` clause.
+
+ Argument places are switched, because ANY requires array
+ expression to be on the right hand-side.
+
+ E.g.::
+
+ from sqlalchemy.sql import operators
+
+ conn.execute(
+ select([table.c.data]).where(
+ table.c.data.any(7, operator=operators.lt)
+ )
+ )
+
+ :param other: expression to be compared
+ :param operator: an operator object from the
+ :mod:`sqlalchemy.sql.operators`
+ package, defaults to :func:`.operators.eq`.
+
+ .. seealso::
+
+ :class:`.postgresql.Any`
+
+ :meth:`.postgresql.ARRAY.Comparator.all`
+
"""
return Any(other, self.expr, operator=operator)
def all(self, other, operator=operators.eq):
- """Return ``other operator ALL (array)`` clause. Argument places
- are switched, because ALL requires array expression to be on the
- right hand-side.
+ """Return ``other operator ALL (array)`` clause.
+
+ Argument places are switched, because ALL requires array
+ expression to be on the right hand-side.
+
+ E.g.::
+
+ from sqlalchemy.sql import operators
+
+ conn.execute(
+ select([table.c.data]).where(
+ table.c.data.all(7, operator=operators.lt)
+ )
+ )
+
+ :param other: expression to be compared
+ :param operator: an operator object from the
+ :mod:`sqlalchemy.sql.operators`
+ package, defaults to :func:`.operators.eq`.
+
+ .. seealso::
+
+ :class:`.postgresql.All`
+
+ :meth:`.postgresql.ARRAY.Comparator.any`
+
"""
return All(other, self.expr, operator=operator)