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

Function readCString

server/conn_extended_query.go:882–895  ·  view source on GitHub ↗

readCString reads a null-terminated string from reader

(r *bytes.Reader)

Source from the content-addressed store, hash-verified

880 var queryRowsAff int64
881 var queryFinalErr error
882 c.logWorkerStatementStarted(workerStatement)
883 defer func() {
884 c.logWorkerStatementFinished(workerStatement, queryStart, queryRowsAff, queryFinalErr)
885 }()
886
887 // The statement context is created above the multi-statement branch; see
888 // the comment there. queryContextInner(false): no disconnect monitor. Like
889 // the cursor path, the monitor's bufio Peek would race the message loop's
890 // own reads — the extended protocol pipelines Parse/Bind/Execute/Sync, so
891 // bytes for the next message are often already buffered. Disconnect still
892 // cancels via c.ctx.
893
894 if !returnsResults {
895 // Open cursors pin the session's single DuckDB connection — release
896 // them before a transaction-end statement needs it.
897 c.closeCursorsAtTxEnd(cmdType)
898

Callers 3

handleParseMethod · 0.85
handleExecuteMethod · 0.85
handleBindMethod · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected