optional
optional copied to clipboard
Optional for sql.Null* types
It would be awesome to have wrappers for sql.Null* types. It will be different from the generated primitive types though.
Example:
o := optional.NewNullInt64(sql.NullInt64{Valid: true, Int64: 55})
The question is, use it like in my example, or just implement sql.Scanner
and sql.Valuer
interfaces?
@markphelps What do you think about also implementing sql.Scanner
and driver.Valuer
for the generated optional types? This would help make this package compatible with most ORMs and drivers and one can use these types in both DTOs and database entities.