This repository has been archived on 2020-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
tests/testExec.go

29 lines
501 B
Go

package tests
import (
"fmt"
"testing"
"xorm.io/xorm"
)
func exec(engine *xorm.Engine, t *testing.T) {
sql := "update userinfo set username=? where id=?"
res, err := engine.Exec(sql, "xiaolun", 1)
if err != nil {
t.Error(err)
panic(err)
}
fmt.Println(res)
}
func execSameMapper(engine *xorm.Engine, t *testing.T) {
sql := "update `Userinfo` set `Username`=? where (id)=?"
res, err := engine.Exec(sql, "xiaolun", 1)
if err != nil {
t.Error(err)
panic(err)
}
fmt.Println(res)
}