mirror of https://github.com/go-gorm/gorm.git
Test map with named argument for raw sql
This commit is contained in:
parent
bba569af2b
commit
c0319f6eed
|
@ -49,7 +49,7 @@ func TestNamedArg(t *testing.T) {
|
|||
}
|
||||
|
||||
var result5 NamedUser
|
||||
if err := DB.Raw("SELECT * FROM named_users WHERE (name1 = @name AND name3 = @name) AND name2 = @name2", sql.Named("name", "jinzhu-new"), sql.Named("name2", "jinzhu-new2")).Find(&result5).Error; err != nil {
|
||||
if err := DB.Raw("SELECT * FROM named_users WHERE (name1 = @name AND name3 = @name) AND name2 = @name2", map[string]interface{}{"name": "jinzhu-new", "name2": "jinzhu-new2"}).Find(&result5).Error; err != nil {
|
||||
t.Errorf("failed to update with named arg")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue