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

Method chooseParameterFormatCode

extended_query_builder.go:139–146  ·  view source on GitHub ↗

chooseParameterFormatCode determines the correct format code for an argument to a prepared statement. It defaults to TextFormatCode if no determination can be made.

(m *pgtype.Map, oid uint32, arg any)

Source from the content-addressed store, hash-verified

137// argument to a prepared statement. It defaults to TextFormatCode if no
138// determination can be made.
139func (eqb *ExtendedQueryBuilder) chooseParameterFormatCode(m *pgtype.Map, oid uint32, arg any) int16 {
140 switch arg.(type) {
141 case string, *string:
142 return TextFormatCode
143 }
144
145 return m.FormatCodeForOID(oid)
146}

Callers 1

appendParamMethod · 0.95

Calls 1

FormatCodeForOIDMethod · 0.80

Tested by

no test coverage detected