Forms the basis of ``UNION``, ``UNION ALL``, and other SELECT-based set operations. .. seealso:: :func:`_expression.union` :func:`_expression.union_all` :func:`_expression.intersect` :func:`_expression.intersect_all` :func:`_expression.except`
| 4509 | |
| 4510 | |
| 4511 | class CompoundSelect(HasCompileState, GenerativeSelect, TypedReturnsRows[_TP]): |
| 4512 | """Forms the basis of ``UNION``, ``UNION ALL``, and other |
| 4513 | SELECT-based set operations. |
| 4514 | |
| 4515 | |
| 4516 | .. seealso:: |
| 4517 | |
| 4518 | :func:`_expression.union` |
| 4519 | |
| 4520 | :func:`_expression.union_all` |
| 4521 | |
| 4522 | :func:`_expression.intersect` |
| 4523 | |
| 4524 | :func:`_expression.intersect_all` |
| 4525 | |
| 4526 | :func:`_expression.except` |
| 4527 | |
| 4528 | :func:`_expression.except_all` |
| 4529 | |
| 4530 | """ |
| 4531 | |
| 4532 | __visit_name__ = "compound_select" |
| 4533 | |
| 4534 | _traverse_internals: _TraverseInternalsType = ( |
| 4535 | [ |
| 4536 | ("selects", InternalTraversal.dp_clauseelement_list), |
| 4537 | ("_limit_clause", InternalTraversal.dp_clauseelement), |
| 4538 | ("_offset_clause", InternalTraversal.dp_clauseelement), |
| 4539 | ("_fetch_clause", InternalTraversal.dp_clauseelement), |
| 4540 | ("_fetch_clause_options", InternalTraversal.dp_plain_dict), |
| 4541 | ("_order_by_clauses", InternalTraversal.dp_clauseelement_list), |
| 4542 | ("_group_by_clauses", InternalTraversal.dp_clauseelement_list), |
| 4543 | ("_for_update_arg", InternalTraversal.dp_clauseelement), |
| 4544 | ("keyword", InternalTraversal.dp_string), |
| 4545 | ] |
| 4546 | + SupportsCloneAnnotations._clone_annotations_traverse_internals |
| 4547 | + HasCTE._has_ctes_traverse_internals |
| 4548 | + DialectKWArgs._dialect_kwargs_traverse_internals |
| 4549 | + Executable._executable_traverse_internals |
| 4550 | ) |
| 4551 | |
| 4552 | selects: List[SelectBase] |
| 4553 | |
| 4554 | _is_from_container = True |
| 4555 | _auto_correlate = False |
| 4556 | |
| 4557 | def __init__( |
| 4558 | self, |
| 4559 | keyword: _CompoundSelectKeyword, |
| 4560 | *selects: _SelectStatementForCompoundArgument[_TP], |
| 4561 | ): |
| 4562 | self.keyword = keyword |
| 4563 | self.selects = [ |
| 4564 | coercions.expect( |
| 4565 | roles.CompoundElementRole, s, apply_propagate_attrs=self |
| 4566 | ).self_group(against=self) |
| 4567 | for s in selects |
| 4568 | ] |
no outgoing calls
no test coverage detected