Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional for sql.Null* types #2

Open
lunemec opened this issue Feb 27, 2018 · 1 comment
Open

Optional for sql.Null* types #2

lunemec opened this issue Feb 27, 2018 · 1 comment

Comments

@lunemec
Copy link

lunemec commented Feb 27, 2018

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?

@amjd
Copy link

amjd commented Nov 12, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants