From caf72c627aa931eadd5d2b2cbaec6c96cc1aeda5 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 5 Jan 2019 17:46:47 -0600 Subject: [PATCH] Add some docs for batch --- pgconn/pgconn.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pgconn/pgconn.go b/pgconn/pgconn.go index d4563086..09d87b31 100644 --- a/pgconn/pgconn.go +++ b/pgconn/pgconn.go @@ -988,6 +988,7 @@ func (pgConn *PgConn) recoverFromTimeout() { } } +// Batch is a collection of queries that can be sent to the PostgreSQL server in a single round-trip. type Batch struct { buf []byte } @@ -1006,6 +1007,7 @@ func (batch *Batch) ExecPrepared(stmtName string, paramValues [][]byte, paramFor batch.buf = (&pgproto3.Execute{}).Encode(batch.buf) } +// ExecBatch executes all the queries in batch in a single round-trip. func (pgConn *PgConn) ExecBatch(ctx context.Context, batch *Batch) *MultiResult { multiResult := &MultiResult{ pgConn: pgConn,