| 7 | |
| 8 | @dataclass |
| 9 | class SQLResult: |
| 10 | preamble: str | None = None |
| 11 | header: list[str] | str | None = None |
| 12 | rows: Cursor | list[tuple] | None = None |
| 13 | postamble: str | None = None |
| 14 | status: str | FormattedText | None = None |
| 15 | command: dict[str, str | float] | None = None |
| 16 | |
| 17 | def __str__(self): |
| 18 | return f"{self.preamble}, {self.header}, {self.rows}, {self.postamble}, {self.status}, {self.command}" |
| 19 | |
| 20 | @cached_property |
| 21 | def status_plain(self): |
| 22 | if self.status is None: |
| 23 | return None |
| 24 | return to_plain_text(self.status) |
no outgoing calls