MCPcopy Index your code
hub / github.com/lib/pq / Scan

Method Scan

array.go:80–92  ·  view source on GitHub ↗

Scan implements the sql.Scanner interface.

(src any)

Source from the content-addressed store, hash-verified

78
79// Scan implements the sql.Scanner interface.
80func (a *BoolArray) Scan(src any) error {
81 switch src := src.(type) {
82 case []byte:
83 return a.scanBytes(src)
84 case string:
85 return a.scanBytes([]byte(src))
86 case nil:
87 *a = nil
88 return nil
89 }
90
91 return fmt.Errorf("pq: cannot convert %T to BoolArray", src)
92}
93
94func (a *BoolArray) scanBytes(src []byte) error {
95 elems, err := scanLinearArray(src, []byte{','}, "BoolArray")

Callers 15

TestStatmentFunction · 0.45
TestEncodeDecodeFunction · 0.45
TestFloatPrecisionFunction · 0.45
TestCommitFunction · 0.45
TestMultipleResultEmptyFunction · 0.45
TestTxOptionsFunction · 0.45
TestPingFunction · 0.45
BenchmarkSelectFunction · 0.45
BenchmarkPreparedSelectFunction · 0.45

Calls 1

scanBytesMethod · 0.95

Tested by 15

TestStatmentFunction · 0.36
TestEncodeDecodeFunction · 0.36
TestFloatPrecisionFunction · 0.36
TestCommitFunction · 0.36
TestMultipleResultEmptyFunction · 0.36
TestTxOptionsFunction · 0.36
TestPingFunction · 0.36
BenchmarkSelectFunction · 0.36
BenchmarkPreparedSelectFunction · 0.36