Skip to content

WireSession

Defined in: packages/pgwasm/src/build/seam.ts:158

One session’s byte channel carrying the wire protocol.

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

close(): Promise<void>

Defined in: packages/pgwasm/src/build/seam.ts:170

Promise<void>


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.

Uint8Array

(chunk) => void

void | Promise<void>