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

Function onData

packages/sql/pg/src/PgConnection.ts:2595–2606  ·  view source on GitHub ↗
(chunk: Uint8Array)

Source from the content-addressed store, hash-verified

2593 }
2594
2595 const onData = (chunk: Uint8Array): void => {
2596 let messages: ReadonlyArray<PgProtocol.BackendMessage<unknown>>
2597 try {
2598 messages = parser!.push(chunk)
2599 } catch (cause) {
2600 return failConnect(cause, "PgConnection: Failed to parse server response")
2601 }
2602 for (const message of messages) {
2603 if (done) return
2604 handleMessage(message)
2605 }
2606 }
2607
2608 const startup = (): void => {
2609 parser = PgProtocol.makeParser<unknown>({ maxMessageSize: config.maxMessageSize })

Callers

nothing calls this directly

Calls 3

failConnectFunction · 0.85
handleMessageFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected