-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Closed
Labels
type:questiongeneral questionsgeneral questions
Description
type product struct {
Title string `gorm:"column:title"`
URL string `gorm:"column:url"`
Server string `gorm:"column:server"`
Amount string `gorm:"column:amount"`
}
func (mp *aaa) Insert(DB *gorm.DB ) error {
products := []*product{}
tmp := &po.Maple8591Product{
Title:"123",
URL:"/test?123",
Server:"aaa",
Amount:"123456",
}
products = append(products,tmp)
return DB.Create(products).Error
}
when the field value have question mark, I expect query is
insert into products (`title`,`url`,`server`,`amount`) values ("123","/test?123","aaa","123456")
but its actually is like
insert into products (`title`,`url`,`server`,`amount`) values ("123","/test"aaa"123","123456",?)
Is it's bug? or I used it wrong?
Metadata
Metadata
Assignees
Labels
type:questiongeneral questionsgeneral questions