MCPcopy Create free account
hub / github.com/Effect-TS/effect / endStatement

Method endStatement

packages/sql/pg/src/PgConnection.ts:1736–1758  ·  view source on GitHub ↗

Saves the statement's result, then waits for `ReadyForQuery` or the next `Parse`.

()

Source from the content-addressed store, hash-verified

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()

Callers 1

onMessageMethod · 0.95

Calls 1

pushMethod · 0.65

Tested by

no test coverage detected