We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
generated code from gentool utility
AppID is defined as a Serial primary key in the database…
// App mapped from table type App struct { AppID int32 gorm:"column:AppID;type:integer;primaryKey;default:nextval('"Apps_AppID_seq"" json:"AppID" Port int32 gorm:"column:Port;type:integer" json:"Port" AppName string gorm:"column:AppName;type:character varying(255);not null" json:"AppName" Description string gorm:"column:Description;type:text" json:"Description" }
gorm:"column:AppID;type:integer;primaryKey;default:nextval('"Apps_AppID_seq"" json:"AppID"
gorm:"column:Port;type:integer" json:"Port"
gorm:"column:AppName;type:character varying(255);not null" json:"AppName"
gorm:"column:Description;type:text" json:"Description"
go-gorm/playground#1
The text was updated successfully, but these errors were encountered:
https://gorm.io/gen/database_to_structs.html#Field-Options
gen.FieldGORMTag("extra", func(tag field.GormTag) field.GormTag { return tag.Set("default", "nextval(xx") })
Sorry, something went wrong.
No branches or pull requests
GORM Playground Link
generated code from gentool utility
AppID is defined as a Serial primary key in the database…
// App mapped from table
type App struct {
AppID int32
gorm:"column:AppID;type:integer;primaryKey;default:nextval('"Apps_AppID_seq"" json:"AppID"
Port int32
gorm:"column:Port;type:integer" json:"Port"
AppName string
gorm:"column:AppName;type:character varying(255);not null" json:"AppName"
Description string
gorm:"column:Description;type:text" json:"Description"
}
go-gorm/playground#1
Description
The text was updated successfully, but these errors were encountered: