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

Method ExecStatement

pgconn/pgconn.go:1310–1321  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

1308//
1309// [ResultReader] must be closed before [PgConn] can be used again.
1310func (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
1323func (pgConn *PgConn) execExtendedPrefix(ctx context.Context, paramValues [][]byte) *ResultReader {
1324 pgConn.resultReader = ResultReader{

Callers

nothing calls this directly

Calls 3

execExtendedPrefixMethod · 0.95
execExtendedSuffixMethod · 0.95
SendBindMethod · 0.80

Tested by

no test coverage detected