Saves the statement's result, then waits for `ReadyForQuery` or the next `Parse`.
()
| 1734 | |
| 1735 | /** Saves the statement's result, then waits for `ReadyForQuery` or the next `Parse`. */ |
| 1736 | private endStatement(): void { |
| 1737 | this.results.push({ |
| 1738 | command: this.command, |
| 1739 | rowCount: this.rowCount, |
| 1740 | oid: this.oid, |
| 1741 | rows: this.rows ?? emptyRows, |
| 1742 | fields: this.resultFields |
| 1743 | }) |
| 1744 | if (--this.remaining === 0) { |
| 1745 | this.phase = "complete" |
| 1746 | return |
| 1747 | } |
| 1748 | this.rows = this.output === "rows" ? [] : undefined |
| 1749 | this.values = this.output === "rows" ? undefined : [] |
| 1750 | this.fieldCount = 0 |
| 1751 | this.resultFields = emptyFields |
| 1752 | this.rowBuilder = undefined |
| 1753 | this.command = "" |
| 1754 | this.rowCount = 0 |
| 1755 | this.oid = null |
| 1756 | this.conn.session.parser.readField = undefined |
| 1757 | this.phase = "parse" |
| 1758 | } |
| 1759 | |
| 1760 | abort(onDrained: () => void): void { |
| 1761 | if (this.done) return onDrained() |