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

Function decodeCopyResponse

packages/sql/pg/src/PgProtocol.ts:1808–1818  ·  view source on GitHub ↗
(
  reader: Reader
)

Source from the content-addressed store, hash-verified

1806}
1807
1808const decodeCopyResponse = (
1809 reader: Reader
1810): { readonly format: number; readonly columnFormats: ReadonlyArray<number> } => {
1811 const format = reader.uint8()
1812 const count = requireNonNegativeCount(reader.int16(), "COPY column")
1813 const columnFormats: Array<number> = new Array(count)
1814 for (let i = 0; i < count; i++) {
1815 columnFormats[i] = reader.int16()
1816 }
1817 return { format, columnFormats }
1818}
1819
1820// The one message that arrives per result row, so it reads the frame directly
1821// instead of going through `Reader`. Callers have already checked that the

Callers 1

decodeBackendFunction · 0.85

Calls 3

requireNonNegativeCountFunction · 0.85
uint8Method · 0.45
int16Method · 0.45

Tested by

no test coverage detected