mirror of https://github.com/go-gorm/gorm.git
parent
5330572c25
commit
b7c6c6af13
|
@ -416,7 +416,7 @@ db.Where("age = ?", 20).Delete(&User{})
|
||||||
|
|
||||||
// Soft deleted records will be ignored when query them
|
// Soft deleted records will be ignored when query them
|
||||||
db.Where("age = 20").Find(&user)
|
db.Where("age = 20").Find(&user)
|
||||||
//// SELECT * FROM users WHERE age = 20 AND (deleted_at IS NULL AND deleted_at <= '0001-01-02');
|
//// SELECT * FROM users WHERE age = 20 AND (deleted_at IS NULL OR deleted_at <= '0001-01-02');
|
||||||
|
|
||||||
// Find soft deleted records with Unscoped
|
// Find soft deleted records with Unscoped
|
||||||
db.Unscoped().Where("age = 20").Find(&users)
|
db.Unscoped().Where("age = 20").Find(&users)
|
||||||
|
|
Loading…
Reference in New Issue