GORM Playground Link
https://github.com/go-gorm/playground/pull/702
Description
When I use the where statement, the printed sql in console is wrong that makes me think there is something wrong with the sql statement.
It should print number rather than string when the underlying type is int.
type UserStatus int
const (
Normal UserStatus = 1
Forbid UserStatus = 2
)
// print: SELECT * FROM `users` WHERE status = '1' AND `users`.`deleted_at` IS NULL
DB.Where("status = ?", Normal).Find(&users)
// print: SELECT * FROM `users` WHERE status = 1 AND `users`.`deleted_at` IS NULL
DB.Where("status = ?", 1).Find(&users)