Soft deletion was mentioned in #276.
Paranoid queries would be a really useful addition. Wondering whether someone is already working on a pull request.
IMO go-pg should not couple with specific field of client code, eg. deleted_at or is_deleted.
And it's easy to implement it in client code:
type Base struct {
DeletedAt *time.Time
}
func (b *Base) SoftDelete() {
now := time.Now()
b.DeletedAt = &now
}
func (b *Base) Undelete() {
b.DeletedAt = nil
}
type User struct {
Base
ID int
Username string
}

I actually built this into my wrapper for pg-go since GORM had this. Put this into your model.go and just call it for deleting
func Delete(m Model, id int64) error {
Read(m, id)
deleted_at := time.Now()
_, err := dbwrapper.DB().Model(m).Set("deleted_at = ?", deleted_at).Where("id = ?", id).Update(&deleted_at)
return err
}
Also I should mention GORM checks to see if you have a deleted_at column. If not then it does a hard delete. So we could have both here.
https://godoc.org/github.com/go-pg/pg#example-DB-Model-SoftDelete
Most helpful comment