From ecdbe8a7c2f2ee34a7870a96396b6805d4504e83 Mon Sep 17 00:00:00 2001 From: Timon Stampfli Date: Sun, 10 Aug 2025 08:57:12 +0000 Subject: [PATCH] fix: generate pointer types for nullable enum columns with emit_pointers_for_null_types --- internal/codegen/golang/postgresql_type.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/codegen/golang/postgresql_type.go b/internal/codegen/golang/postgresql_type.go index 398d01e2e8..56d696daf6 100644 --- a/internal/codegen/golang/postgresql_type.go +++ b/internal/codegen/golang/postgresql_type.go @@ -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)