(ctx context.Context, b *Batch)
| 1037 | } |
| 1038 | |
| 1039 | func (c *Conn) sendBatchQueryExecModeExec(ctx context.Context, b *Batch) *batchResults { |
| 1040 | batch := &pgconn.Batch{} |
| 1041 | |
| 1042 | for _, bi := range b.QueuedQueries { |
| 1043 | sd := bi.sd |
| 1044 | if sd != nil { |
| 1045 | err := c.eqb.Build(c.typeMap, sd, bi.Arguments) |
| 1046 | if err != nil { |
| 1047 | return &batchResults{ctx: ctx, conn: c, err: err} |
| 1048 | } |
| 1049 | |
| 1050 | batch.ExecPrepared(sd.Name, c.eqb.ParamValues, c.eqb.ParamFormats, c.eqb.ResultFormats) |
| 1051 | } else { |
| 1052 | err := c.eqb.Build(c.typeMap, nil, bi.Arguments) |
| 1053 | if err != nil { |
| 1054 | return &batchResults{ctx: ctx, conn: c, err: err} |
| 1055 | } |
| 1056 | batch.ExecParams(bi.SQL, c.eqb.ParamValues, nil, c.eqb.ParamFormats, c.eqb.ResultFormats) |
| 1057 | } |
| 1058 | } |
| 1059 | |
| 1060 | c.eqb.reset() // Allow c.eqb internal memory to be GC'ed as soon as possible. |
| 1061 | |
| 1062 | mrr := c.pgConn.ExecBatch(ctx, batch) |
| 1063 | |
| 1064 | return &batchResults{ |
| 1065 | ctx: ctx, |
| 1066 | conn: c, |
| 1067 | mrr: mrr, |
| 1068 | b: b, |
| 1069 | qqIdx: 0, |
| 1070 | } |
| 1071 | } |
| 1072 | |
| 1073 | func (c *Conn) sendBatchQueryExecModeCacheStatement(ctx context.Context, b *Batch) (pbr *pipelineBatchResults) { |
| 1074 | if c.statementCache == nil { |
no test coverage detected