You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have my own type for postgres inet but it is mapped to a string in the loader (similar to issue #122). I currently fork xo and remove inet from the case statement so that it matches the default case. I can take it from there in the same way I handle macaddr and cidr types. Another solution is to match on the table and field name in the go template. It is error-prone as I'd need to update the template every time a new field of this type is added.
Would it be possible to have access to the SQL type and nullable bool (and maybe more) in the go template Field struct? That would allow me to update the type as needed. This is already available in json due to the way it's generated, so not entirely unprecedented.
I have a similar issue with integers. We would like to use sql.NullInt32 for their null type. I understand that can't be made default as it was added later in go 1.13. Adding the sql type and nullable bool would help with this too.
The text was updated successfully, but these errors were encountered:
We have plans to introduce a general type mapping functionality that would allow overriding the generated types, but have not had time to implement it yet.
I have my own type for postgres
inet
but it is mapped to a string in the loader (similar to issue #122). I currently fork xo and remove inet from the case statement so that it matches the default case. I can take it from there in the same way I handlemacaddr
andcidr
types. Another solution is to match on the table and field name in the go template. It is error-prone as I'd need to update the template every time a new field of this type is added.Would it be possible to have access to the SQL type and nullable bool (and maybe more) in the go template Field struct? That would allow me to update the type as needed. This is already available in json due to the way it's generated, so not entirely unprecedented.
I have a similar issue with integers. We would like to use
sql.NullInt32
for their null type. I understand that can't be made default as it was added later in go 1.13. Adding the sql type and nullable bool would help with this too.The text was updated successfully, but these errors were encountered: