Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OnlyTrashed ¶
OnlyTrashed returns a GORM scope that returns only soft-deleted records.
db.Scopes(models.OnlyTrashed).Find(&users)
Types ¶
type BaseModel ¶
type BaseModel struct {
ID uint `gorm:"primaryKey" json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at,omitempty"`
}
BaseModel provides common fields for all models. Embed this in your model structs to get ID, CreatedAt, UpdatedAt, and soft delete support via DeletedAt.
Click to show internal directories.
Click to hide internal directories.