package
0.0.0-20250221025053-c3ab81728e88
Repository: https://github.com/denglitong/golang.git
Documentation: pkg.go.dev

# Functions

No description provided by the author
No description provided by the author
GetAll Retrieve user list with eager loading credit cards.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
CreditCard belongs to UserModel, UserID is the foreign key.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
User belongs to Company, CompanyID is the foreign key.
User2 has and belongs to many languages, `user_languages` is the join table When using GORM AutoMigrate to create a table for User, GORM will create the join table automatically.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UserM has many CreditCards, UserID is the foreign key.
UserModel has one CreditCard, UserID is the foreign key.
UserModelOverrideForeignKey For a has one relationship, a foreign key field must also exist, the owner will save the primary key of the model belongs to it into this field.
UserModelOverrideReferences When save User model, save User.name to CreditCard.UserName as to set up the foreign key.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UserSpecifyReference GORM usually guess the relationship as `has one` if override foreign key name already exists in owner's type, we need to specify references in the belongs to relationship.