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)
| 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. |
| 69 | func 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. |