Value implements the [driver.Valuer] interface.
()
| 45 | |
| 46 | // Value implements the [driver.Valuer] interface. |
| 47 | func (j JSONRaw) Value() (driver.Value, error) { |
| 48 | if len(j) == 0 { |
| 49 | return nil, nil |
| 50 | } |
| 51 | |
| 52 | return j.String(), nil |
| 53 | } |
| 54 | |
| 55 | // Scan implements [sql.Scanner] interface to scan the provided value |
| 56 | // into the current JSONRaw instance. |