Feature model fix (#362)

* fix sql builderx adding raw string quotation marks incompatibility bug

* add unit test

* remove comments

* fix sql builderx adding raw string quotation marks incompatibility bug
This commit is contained in:
anqiansong
2021-01-08 12:01:21 +08:00
committed by GitHub
parent 57b73d8b49
commit 6c624a6ed0
7 changed files with 72 additions and 26 deletions

View File

@@ -102,7 +102,7 @@ func TestFields(t *testing.T) {
UpdateTime sql.NullTime `db:"update_time"`
}
var (
studentFieldNames = builderx.FieldNames(&Student{})
studentFieldNames = builderx.RawFieldNames(&Student{})
studentRows = strings.Join(studentFieldNames, ",")
studentRowsExpectAutoSet = strings.Join(stringx.Remove(studentFieldNames, "`id`", "`create_time`", "`update_time`"), ",")
studentRowsWithPlaceHolder = strings.Join(stringx.Remove(studentFieldNames, "`id`", "`create_time`", "`update_time`"), "=?,") + "=?"