MCPcopy Index your code
hub / github.com/aarondl/sqlboiler / Scan

Method Scan

types/array.go:943–955  ·  view source on GitHub ↗

Scan implements the sql.Scanner interface.

(src any)

Source from the content-addressed store, hash-verified

941
942// Scan implements the sql.Scanner interface.
943func (a *StringArray) Scan(src any) error {
944 switch src := src.(type) {
945 case []byte:
946 return a.scanBytes(src)
947 case string:
948 return a.scanBytes([]byte(src))
949 case nil:
950 *a = nil
951 return nil
952 }
953
954 return fmt.Errorf("boil: cannot convert %T to StringArray", src)
955}
956
957func (a *StringArray) scanBytes(src []byte) error {
958 elems, err := scanLinearArray(src, []byte{','}, "StringArray")

Callers 7

TestStringArrayScanEmptyFunction · 0.95
TestStringArrayScanNilFunction · 0.95
TestStringArrayScanBytesFunction · 0.95
TestStringArrayScanErrorFunction · 0.95

Calls 1

scanBytesMethod · 0.95

Tested by 7

TestStringArrayScanEmptyFunction · 0.76
TestStringArrayScanNilFunction · 0.76
TestStringArrayScanBytesFunction · 0.76
TestStringArrayScanErrorFunction · 0.76