go-gorm / go-gorm/cli

struct/slice fields are not relations but json fields but get generated as relations

Open
#41 0 comments 0 reactions 1 assignee Claimed by @jinzhu View on GitHub
Dominant language
Go
Stars
108
Forks
15
PR merge metrics
No merged PRs in 30d

Description

## GORM Playground Link
https://github.com/go-gorm/playground/pull/842

## Description

Fields with the gorm:"serializer:json" tag are incorrectly generated as relations instead of columns. The generator ignores the specified column:name tag and outputs .WithName("FieldName") (used for associations) instead of .WithColumn("db_name").

For example, JsonSlice is defined with column:json_slice, but the generated code produces field.Slice[string]{}.WithName("JsonSlice"). It should generate .WithColumn("json_slice") to correctly map to the serialized database column.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.