Open kyleconroy opened 10 months ago
What if you could configure any generic type to wrap nulls? Something like:
go:
...
generic_null_type:
import: "my/custom/null"
type: "Null"
...
and then a nullable string
column would be generated as null.Null[string]
.
Use case: sql.Null
doesn't appear to have good JSON marshaling, it would be nice to be able to choose an option that does.
This is kind of doable currently by overriding every single nullable type individually in the config.
Put together an implementation of my above suggestion in #3202
What do you want to change?
Go 1.22 includes a generic Null type.
Null represents a value that may be null. Null implements the Scanner interface so it can be used as a scan destination:
This would make our lives much easier when generating code
What database engines need to be changed?
No response
What programming language backends need to be changed?
No response