Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@wangzeping722
Copy link
Contributor

@wangzeping722 wangzeping722 commented Mar 21, 2024

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

ref: #6898

The wrong sql printed to the terminal can be confusing when use type XXX int, so fix it.

User Case Description

type UserStatus int

const (
	Normal UserStatus = 1
	Forbid UserStatus = 2
)

DB.Where("status = ?", Normal).Find(&users)

It print:

SELECT * FROM `users` WHERE status = '1' AND `users`.`deleted_at` IS NULL

The expected print is:

SELECT * FROM `users` WHERE status = 1 AND `users`.`deleted_at` IS NULL

@jinzhu jinzhu merged commit 956f7ce into go-gorm:master Mar 21, 2024
@jinzhu
Copy link
Member

jinzhu commented Mar 21, 2024

thank you for your PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants