Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: generate pointer types for nullable enum columns with emit_point…
…ers_for_null_types
  • Loading branch information
stammon committed Aug 10, 2025
commit ecdbe8a7c2f2ee34a7870a96396b6805d4504e83
5 changes: 5 additions & 0 deletions internal/codegen/golang/postgresql_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,11 @@ func postgresType(req *plugin.GenerateRequest, options *opts.Options, col *plugi
return StructName(enum.Name, options)
}
return StructName(schema.Name+"_"+enum.Name, options)
} else if emitPointersForNull {
if schema.Name == req.Catalog.DefaultSchema {
return "*" + StructName(enum.Name, options)
}
return "*" + StructName(schema.Name+"_"+enum.Name, options)
} else {
if schema.Name == req.Catalog.DefaultSchema {
return "Null" + StructName(enum.Name, options)
Expand Down
Loading