ExecStatement enqueues the execution of a prepared statement via the PostgreSQL extended query protocol. This differs from [PgConn.ExecPrepared] in that it takes a [*StatementDescription] instead of the prepared statement name. Because it has the [*StatementDescription] it can avoid the Describe Po
(ctx context.Context, statementDescription *StatementDescription, paramValues [][]byte, paramFormats, resultFormats []int16)
| 1308 | // |
| 1309 | // [ResultReader] must be closed before [PgConn] can be used again. |
| 1310 | func (pgConn *PgConn) ExecStatement(ctx context.Context, statementDescription *StatementDescription, paramValues [][]byte, paramFormats, resultFormats []int16) *ResultReader { |
| 1311 | result := pgConn.execExtendedPrefix(ctx, paramValues) |
| 1312 | if result.closed { |
| 1313 | return result |
| 1314 | } |
| 1315 | |
| 1316 | pgConn.frontend.SendBind(&pgproto3.Bind{PreparedStatement: statementDescription.Name, ParameterFormatCodes: paramFormats, Parameters: paramValues, ResultFormatCodes: resultFormats}) |
| 1317 | |
| 1318 | pgConn.execExtendedSuffix(result, statementDescription, resultFormats) |
| 1319 | |
| 1320 | return result |
| 1321 | } |
| 1322 | |
| 1323 | func (pgConn *PgConn) execExtendedPrefix(ctx context.Context, paramValues [][]byte) *ResultReader { |
| 1324 | pgConn.resultReader = ResultReader{ |
nothing calls this directly
no test coverage detected