Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(codegen/golang): handle go_struct_tag for db_type overrides
Resolves #3143
  • Loading branch information
andrewmbenton committed Aug 11, 2025
commit 08c808de3860405e40350121950bc249a8c3bf13
10 changes: 10 additions & 0 deletions internal/codegen/golang/go_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ func addExtraGoStructTags(tags map[string]string, req *plugin.GenerateRequest, o
if oride.GoType.StructTags == nil {
continue
}
if oride.DbType != "" {
columnType := sdk.DataType(col.Type)
if columnType != oride.DbType {
continue
}
for k, v := range oride.GoType.StructTags {
tags[k] = v
}
continue
}
if !override.Matches(col.Table, req.Catalog.DefaultSchema) {
// Different table.
continue
Expand Down