Value implements the driver.Valuer interface.
()
| 1056 | |
| 1057 | // Value implements the driver.Valuer interface. |
| 1058 | func (a DecimalArray) Value() (driver.Value, error) { |
| 1059 | if a == nil { |
| 1060 | return nil, nil |
| 1061 | } else if len(a) == 0 { |
| 1062 | return "{}", nil |
| 1063 | } |
| 1064 | |
| 1065 | strs := make([]string, len(a)) |
| 1066 | for i, d := range a { |
| 1067 | strs[i] = d.String() |
| 1068 | } |
| 1069 | |
| 1070 | return "{" + strings.Join(strs, ",") + "}", nil |
| 1071 | } |
| 1072 | |
| 1073 | // Randomize for sqlboiler |
| 1074 | func (a *DecimalArray) Randomize(nextInt func() int64, fieldType string, shouldBeNull bool) { |