Return ``other operator ALL (array)`` clause. Usage of array-specific :meth:`_types.ARRAY.Comparator.all` is as follows:: from sqlalchemy.sql import operators conn.execute( select(table.c.data).where(table.c.data.all(7, o
(
self, other: Any, operator: Optional[OperatorType] = None
)
| 3274 | ) |
| 3275 | @util.preload_module("sqlalchemy.sql.elements") |
| 3276 | def all( |
| 3277 | self, other: Any, operator: Optional[OperatorType] = None |
| 3278 | ) -> ColumnElement[bool]: |
| 3279 | """Return ``other operator ALL (array)`` clause. |
| 3280 | |
| 3281 | Usage of array-specific :meth:`_types.ARRAY.Comparator.all` |
| 3282 | is as follows:: |
| 3283 | |
| 3284 | from sqlalchemy.sql import operators |
| 3285 | |
| 3286 | conn.execute( |
| 3287 | select(table.c.data).where(table.c.data.all(7, operator=operators.lt)) |
| 3288 | ) |
| 3289 | |
| 3290 | :param other: expression to be compared |
| 3291 | :param operator: an operator object from the |
| 3292 | :mod:`sqlalchemy.sql.operators` |
| 3293 | package, defaults to :func:`.operators.eq`. |
| 3294 | |
| 3295 | .. seealso:: |
| 3296 | |
| 3297 | :func:`_expression.all_` |
| 3298 | |
| 3299 | :meth:`.types.ARRAY.Comparator.any` |
| 3300 | |
| 3301 | """ # noqa: E501 |
| 3302 | elements = util.preloaded.sql_elements |
| 3303 | operator = operator if operator else operators.eq |
| 3304 | |
| 3305 | arr_type = self.type |
| 3306 | |
| 3307 | return elements.CollectionAggregate._create_all(self.expr).operate( |
| 3308 | operators.mirror(operator), |
| 3309 | coercions.expect( |
| 3310 | roles.BinaryElementRole, |
| 3311 | element=other, |
| 3312 | operator=operator, |
| 3313 | expr=self.expr, |
| 3314 | bindparam_type=arr_type.item_type, |
| 3315 | ), |
| 3316 | ) |
| 3317 | |
| 3318 | comparator_factory = Comparator |
| 3319 |
nothing calls this directly
no test coverage detected