Skip to content

Commit c8d85f7

Browse files
committed
Add support for nullable json fieds in MySQL.
1 parent cfe6c55 commit c8d85f7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/codegen/golang/mysql_type.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ func mysqlType(req *plugin.GenerateRequest, options *opts.Options, col *plugin.C
108108
return "sql.NullBool"
109109

110110
case "json":
111-
return "json.RawMessage"
111+
if notNull {
112+
return "json.RawMessage"
113+
}
114+
return "*json.RawMessage"
112115

113116
case "any":
114117
return "interface{}"

0 commit comments

Comments
 (0)