reset readies eqb to build another query.
()
| 94 | |
| 95 | // reset readies eqb to build another query. |
| 96 | func (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 | |
| 118 | func (eqb *ExtendedQueryBuilder) encodeExtendedParamValue(m *pgtype.Map, oid uint32, formatCode int16, arg any) ([]byte, error) { |
| 119 | if eqb.paramValueBytes == nil { |
no outgoing calls
no test coverage detected