Skip to content

Commit ecdbe8a

Browse files
committed
fix: generate pointer types for nullable enum columns with emit_pointers_for_null_types
1 parent 6ae5bcc commit ecdbe8a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/codegen/golang/postgresql_type.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,11 @@ func postgresType(req *plugin.GenerateRequest, options *opts.Options, col *plugi
576576
return StructName(enum.Name, options)
577577
}
578578
return StructName(schema.Name+"_"+enum.Name, options)
579+
} else if emitPointersForNull {
580+
if schema.Name == req.Catalog.DefaultSchema {
581+
return "*" + StructName(enum.Name, options)
582+
}
583+
return "*" + StructName(schema.Name+"_"+enum.Name, options)
579584
} else {
580585
if schema.Name == req.Catalog.DefaultSchema {
581586
return "Null" + StructName(enum.Name, options)

0 commit comments

Comments
 (0)