MCPcopy Create free account
hub / github.com/PostHog/duckgres / WriteCopyOutResponse

Function WriteCopyOutResponse

server/wire/protocol.go:332–359  ·  view source on GitHub ↗

writeCopyOutResponse tells client we're about to send COPY data Format: overall format (0=text, 1=binary), num columns, format per column

(w io.Writer, numColumns int16, textFormat bool)

Source from the content-addressed store, hash-verified

330func WriteBindComplete(w io.Writer) error {
331 return WriteMessage(w, MsgBindComplete, nil)
332}
333
334// writeCloseComplete sends close complete
335func WriteCloseComplete(w io.Writer) error {
336 return WriteMessage(w, MsgCloseComplete, nil)
337}
338
339// writeNoData sends no data response
340func WriteNoData(w io.Writer) error {
341 return WriteMessage(w, MsgNoData, nil)
342}
343
344// WritePortalSuspended signals that Execute reached its row-count limit
345// before exhausting the portal; the client issues another Execute on the
346// same portal to continue fetching.
347func WritePortalSuspended(w io.Writer) error {
348 return WriteMessage(w, MsgPortalSuspended, nil)
349}
350
351// writeCopyOutResponse tells client we're about to send COPY data
352// Format: overall format (0=text, 1=binary), num columns, format per column
353func WriteCopyOutResponse(w io.Writer, numColumns int16, textFormat bool) error {
354 var data []byte
355
356 // Overall format (0=text)
357 if textFormat {
358 data = append(data, 0)
359 } else {
360 data = append(data, 1)
361 }
362

Callers 2

handleCopyOutMethod · 0.92
handleCopyOutBinaryMethod · 0.92

Calls 1

WriteMessageFunction · 0.85

Tested by

no test coverage detected