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

Function bindMessageBody

server/conn_bind_test.go:29–39  ·  view source on GitHub ↗

bindMessageBody builds a Bind message body (without the type byte and length prefix) for portal/statement names with raw trailing fields.

(portal, stmt string, fields ...any)

Source from the content-addressed store, hash-verified

27// bindMessageBody builds a Bind message body (without the type byte and
28// length prefix) for portal/statement names with raw trailing fields.
29func bindMessageBody(portal, stmt string, fields ...any) []byte {
30 var buf bytes.Buffer
31 buf.WriteString(portal)
32 buf.WriteByte(0)
33 buf.WriteString(stmt)
34 buf.WriteByte(0)
35 for _, f := range fields {
36 _ = binary.Write(&buf, binary.BigEndian, f)
37 }
38 return buf.Bytes()
39}
40
41func newBindTestConn(out *bytes.Buffer) *clientConn {
42 return &clientConn{

Calls 1

WriteMethod · 0.45

Tested by

no test coverage detected