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

Method sendBatchQueryExecModeSimpleProtocol

conn.go:1017–1037  ·  view source on GitHub ↗
(ctx context.Context, b *Batch)

Source from the content-addressed store, hash-verified

1015}
1016
1017func (c *Conn) sendBatchQueryExecModeSimpleProtocol(ctx context.Context, b *Batch) *batchResults {
1018 var sb strings.Builder
1019 for i, bi := range b.QueuedQueries {
1020 if i > 0 {
1021 sb.WriteByte(';')
1022 }
1023 sql, err := c.sanitizeForSimpleQuery(bi.SQL, bi.Arguments...)
1024 if err != nil {
1025 return &batchResults{ctx: ctx, conn: c, err: err}
1026 }
1027 sb.WriteString(sql)
1028 }
1029 mrr := c.pgConn.Exec(ctx, sb.String())
1030 return &batchResults{
1031 ctx: ctx,
1032 conn: c,
1033 mrr: mrr,
1034 b: b,
1035 qqIdx: 0,
1036 }
1037}
1038
1039func (c *Conn) sendBatchQueryExecModeExec(ctx context.Context, b *Batch) *batchResults {
1040 batch := &pgconn.Batch{}

Callers 1

SendBatchMethod · 0.95

Calls 3

ExecMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected