Value implements the driver.Valuer interface for database serialization.
()
| 2066 | |
| 2067 | // Value implements the driver.Valuer interface for database serialization. |
| 2068 | func (d NullDecimal) Value() (driver.Value, error) { |
| 2069 | if !d.Valid { |
| 2070 | return nil, nil |
| 2071 | } |
| 2072 | return d.Decimal.Value() |
| 2073 | } |
| 2074 | |
| 2075 | // UnmarshalJSON implements the json.Unmarshaler interface. |
| 2076 | func (d *NullDecimal) UnmarshalJSON(decimalBytes []byte) error { |