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

Method scanBytes

types/array.go:1036–1055  ·  view source on GitHub ↗
(src []byte)

Source from the content-addressed store, hash-verified

1034}
1035
1036func (a *DecimalArray) scanBytes(src []byte) error {
1037 elems, err := scanLinearArray(src, []byte{','}, "DecimalArray")
1038 if err != nil {
1039 return err
1040 }
1041 if *a != nil && len(elems) == 0 {
1042 *a = (*a)[:0]
1043 } else {
1044 b := make(DecimalArray, len(elems))
1045 for i, v := range elems {
1046 var success bool
1047 b[i].Big, success = new(decimal.Big).SetString(string(v))
1048 if !success {
1049 return fmt.Errorf("boil: parsing decimal element index as decimal %d: %s", i, v)
1050 }
1051 }
1052 *a = b
1053 }
1054 return nil
1055}
1056
1057// Value implements the driver.Valuer interface.
1058func (a DecimalArray) Value() (driver.Value, error) {

Callers 1

ScanMethod · 0.95

Calls 1

scanLinearArrayFunction · 0.85

Tested by

no test coverage detected