optional icon indicating copy to clipboard operation
optional copied to clipboard

Optional for sql.Null* types

Open lunemec opened this issue 6 years ago • 1 comments

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?

lunemec avatar Feb 27 '18 12:02 lunemec

@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.

amjd avatar Nov 12 '21 09:11 amjd