Scan implements the sql.Scanner interface.
(src any)
| 577 | |
| 578 | // Scan implements the sql.Scanner interface. |
| 579 | func (a *BytesArray) Scan(src any) error { |
| 580 | switch src := src.(type) { |
| 581 | case []byte: |
| 582 | return a.scanBytes(src) |
| 583 | case string: |
| 584 | return a.scanBytes([]byte(src)) |
| 585 | case nil: |
| 586 | *a = nil |
| 587 | return nil |
| 588 | } |
| 589 | |
| 590 | return fmt.Errorf("boil: cannot convert %T to BytesArray", src) |
| 591 | } |
| 592 | |
| 593 | func (a *BytesArray) scanBytes(src []byte) error { |
| 594 | elems, err := scanLinearArray(src, []byte{','}, "BytesArray") |