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

Method Value

pgtype/bits.go:52–62  ·  pgtype/bits.go::Bits.Value

Value implements the [database/sql/driver.Valuer] interface.

()

Source from the content-addressed store, hash-verified

50
51// Value implements the [database/sql/driver.Valuer] interface.
52func (src Bits) Value() (driver.Value, error) {
53 if !src.Valid {
54 return nil, nil
55 }
56
57 buf, err := BitsCodec{}.PlanEncode(nil, 0, TextFormatCode, src).Encode(src, nil)
58 if err != nil {
59 return nil, err
60 }
61 return string(buf), err
62}
63
64type BitsCodec struct{}
65

Callers

nothing calls this directly

Calls 2

EncodeMethod · 0.65
PlanEncodeMethod · 0.65

Tested by

no test coverage detected