| 1034 | } |
| 1035 | |
| 1036 | func (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. |
| 1058 | func (a DecimalArray) Value() (driver.Value, error) { |