MCPcopy
hub / github.com/jackc/pgx / NewFrontend

Function NewFrontend

pgproto3/frontend.go:69–72  ·  view source on GitHub ↗

NewFrontend creates a new Frontend. The maximum accepted message body length defaults to the same ~1 GiB limit the PostgreSQL server enforces on inbound messages (PQ_LARGE_MESSAGE_LIMIT in src/include/libpq/libpq.h). Use [Frontend.SetMaxBodyLen] to change or remove the limit.

(r io.Reader, w io.Writer)

Source from the content-addressed store, hash-verified

67// server enforces on inbound messages (PQ_LARGE_MESSAGE_LIMIT in src/include/libpq/libpq.h).
68// Use [Frontend.SetMaxBodyLen] to change or remove the limit.
69func NewFrontend(r io.Reader, w io.Writer) *Frontend {
70 cr := newChunkReader(r, 0)
71 return &Frontend{cr: cr, w: w, maxBodyLen: maxMessageBodyLen}
72}
73
74// Send sends a message to the backend (i.e. the server). The message is buffered until Flush is called. Any error
75// encountered will be returned from Flush.

Callers 6

FuzzFrontendFunction · 0.92
TestErrorResponseFunction · 0.92
NewFunction · 0.92

Calls 1

newChunkReaderFunction · 0.85

Tested by 5

FuzzFrontendFunction · 0.74
TestErrorResponseFunction · 0.74