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

Method reset

extended_query_builder.go:96–116  ·  view source on GitHub ↗

reset readies eqb to build another query.

()

Source from the content-addressed store, hash-verified

94
95// reset readies eqb to build another query.
96func (eqb *ExtendedQueryBuilder) reset() {
97 eqb.ParamValues = eqb.ParamValues[0:0]
98 eqb.paramValueBytes = eqb.paramValueBytes[0:0]
99 eqb.ParamFormats = eqb.ParamFormats[0:0]
100 eqb.ResultFormats = eqb.ResultFormats[0:0]
101
102 if cap(eqb.ParamValues) > 64 {
103 eqb.ParamValues = make([][]byte, 0, 64)
104 }
105
106 if cap(eqb.paramValueBytes) > 256 {
107 eqb.paramValueBytes = make([]byte, 0, 256)
108 }
109
110 if cap(eqb.ParamFormats) > 64 {
111 eqb.ParamFormats = make([]int16, 0, 64)
112 }
113 if cap(eqb.ResultFormats) > 64 {
114 eqb.ResultFormats = make([]int16, 0, 64)
115 }
116}
117
118func (eqb *ExtendedQueryBuilder) encodeExtendedParamValue(m *pgtype.Map, oid uint32, formatCode int16, arg any) ([]byte, error) {
119 if eqb.paramValueBytes == nil {

Callers 7

BuildMethod · 0.95
execParamsMethod · 0.80
execPreparedMethod · 0.80
execSQLParamsMethod · 0.80
QueryMethod · 0.80
putMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected