Scan implements the sql.Scanner interface.
(src any)
| 266 | |
| 267 | // Scan implements the sql.Scanner interface. |
| 268 | func (a *ArrayString) Scan(src any) error { |
| 269 | switch v := src.(type) { |
| 270 | case string: |
| 271 | return json.Unmarshal([]byte(v), a) |
| 272 | case []byte: |
| 273 | return json.Unmarshal(v, a) |
| 274 | default: |
| 275 | return errors.New("invalid type") |
| 276 | } |
| 277 | } |
| 278 | |
| 279 | // getTaskSchema returns the task map of the given database. |
| 280 | // |