WireSession
Defined in: packages/pgwasm/src/build/seam.ts:158
One session’s byte channel carrying the wire protocol.
Properties
Section titled “Properties”onUnsolicited
Section titled “onUnsolicited”onUnsolicited: ((
chunk) =>void) |undefined
Defined in: packages/pgwasm/src/build/seam.ts:169
Set by pgwasm: backend bytes that arrive between exchanges (another session’s NOTIFY).
Methods
Section titled “Methods”close()
Section titled “close()”close():
Promise<void>
Defined in: packages/pgwasm/src/build/seam.ts:170
Returns
Section titled “Returns”Promise<void>
exchange()
Section titled “exchange()”exchange(
message,onData):void|Promise<void>
Defined in: packages/pgwasm/src/build/seam.ts:167
Send frontend bytes and stream every byte of the COMPLETE reply into onData; settle when it is
complete. A build on a real wire frames the reply itself (a Flush after a non-terminal message, then
read to its terminator). Returns undefined when it completed synchronously, which it always does
when capabilities.synchronousExchange. A chunk is only valid during the callback: copy it to keep
it. A throw is a failure of the build, never an SQL error (those arrive in-band as ErrorResponse),
and pgwasm fails the instance. A message starting with a 0 byte is a startup packet.
Parameters
Section titled “Parameters”message
Section titled “message”Uint8Array
onData
Section titled “onData”(chunk) => void
Returns
Section titled “Returns”void | Promise<void>