(src []byte)
| 166 | } |
| 167 | |
| 168 | func (a *ByteaArray) scanBytes(src []byte) error { |
| 169 | elems, err := scanLinearArray(src, []byte{','}, "ByteaArray") |
| 170 | if err != nil { |
| 171 | return err |
| 172 | } |
| 173 | if *a != nil && len(elems) == 0 { |
| 174 | *a = (*a)[:0] |
| 175 | } else { |
| 176 | b := make(ByteaArray, len(elems)) |
| 177 | for i, v := range elems { |
| 178 | b[i], err = parseBytea(v) |
| 179 | if err != nil { |
| 180 | return fmt.Errorf("could not parse bytea array index %d: %w", i, err) |
| 181 | } |
| 182 | } |
| 183 | *a = b |
| 184 | } |
| 185 | return nil |
| 186 | } |
| 187 | |
| 188 | // Value implements the driver.Valuer interface. It uses the "hex" format which |
| 189 | // is only supported on PostgreSQL 9.0 or newer. |
no test coverage detected