Replies: 2 comments 5 replies
-
if using vim and vim-go plugin , you can try command :GoAddTags gorm , |
Beta Was this translation helpful? Give feedback.
3 replies
-
edit your gqlgen.yml |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it allowed to manually edit models_gen file to add gorm tags to the generated model?
Example:
Exact model I need:
type User struct {
ID uint64
json:"-" gorm:"primaryKey;autoIncrement"
Email string
json:"email" binding:"email,required" gorm:"unique; not null"
FirstName string
json:"first_name" LastName string
json:"last_name"Country string
json:"country" CreatedAt time.Time
json:"created_at" gorm:"autoCreateTime"UpdatedAt time.Time
json:"updated_at" gorm:"autoUpdateTime"DeletedAt gorm.DeletedAt
json:"deleted_at"`}
Model generated:
type User struct {
ID string
json:"id"
Email string
json:"email"
FirstName *string
json:"first_name"
LastName *string
json:"last_name"
Country *string
json:"country"
CreatedAt *time.Time
json:"created_at"
UpdatedAt *time.Time
json:"updated_at"
DeletedAt *time.Time
json:"deleted_at"
}
Please I need answer to this, thanks.
Beta Was this translation helpful? Give feedback.
All reactions