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
iredmail
changed the title
Is there a tag like omitempty in json package to ignore non-existing SQL column?
Is there a tag ignore non-existing SQL column?
Jan 12, 2023
Dear all,
Is there a tag like
omitempty
in json package to ignore non-existing SQL columns and use zero value instead? For exampleSQL column
otp_enabled
doesn't exist in old versions of our program, but it's used while login before user can apply the SQL structure changes.Situation
With latest goqu release
v9.18.0
, it raises error message likeError 1054: Unknown column 'otp_enabled' in 'field list'
.Expected behaviour
I expect goqu to ignore this column and use a zero value (false) of the data type (bool) with a tag. e.g.
goqu:"zeroifmissing"
.Addtional
I found 3 tags supported by goqu, but none of them is suitable for my case.
goqu:"skipinsert"
goqu:"skipupdate"
goqu:"defaultifempty"
The text was updated successfully, but these errors were encountered: