A representation of a UNION clause. If the member variable "all" is True, the instance represents a "UNION ALL".
| 642 | |
| 643 | |
| 644 | class UnionClause(object): |
| 645 | '''A representation of a UNION clause. |
| 646 | |
| 647 | If the member variable "all" is True, the instance represents a "UNION ALL". |
| 648 | |
| 649 | ''' |
| 650 | |
| 651 | def __init__(self, query): |
| 652 | self.query = query |
| 653 | self.all = False |
| 654 | |
| 655 | @property |
| 656 | def queries(self): |
| 657 | queries = list() |
| 658 | query = self.query |
| 659 | while True: |
| 660 | queries.append(query) |
| 661 | if not query.union_clause: |
| 662 | break |
| 663 | query = query.union_clause.query |
| 664 | return queries |
| 665 | |
| 666 | def __deepcopy__(self, memo): |
| 667 | other = UnionClause(deepcopy(self.query, memo)) |
| 668 | other.all = self.all |
| 669 | return other |
| 670 | |
| 671 | |
| 672 | class OrderByClause(object): |
no outgoing calls
no test coverage detected