Remove engine.Sql
This commit is contained in:
parent
cd5244ee2c
commit
6b71006866
|
@ -290,11 +290,6 @@ func (engine *Engine) logSQLExecutionTime(sqlStr string, args []interface{}, exe
|
||||||
return executionBlock()
|
return executionBlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sql will be depracated, please use SQL instead
|
|
||||||
func (engine *Engine) Sql(querystring string, args ...interface{}) *Session {
|
|
||||||
return engine.SQL(querystring, args...)
|
|
||||||
}
|
|
||||||
|
|
||||||
// SQL method let's you manualy write raw SQL and operate
|
// SQL method let's you manualy write raw SQL and operate
|
||||||
// For example:
|
// For example:
|
||||||
//
|
//
|
||||||
|
|
|
@ -56,7 +56,7 @@ func main() {
|
||||||
fmt.Println(info)
|
fmt.Println(info)
|
||||||
|
|
||||||
infos := make([]LoginInfo1, 0)
|
infos := make([]LoginInfo1, 0)
|
||||||
err = Orm.Sql(`select *, (select name from user where id = login_info.user_id) as user_name from
|
err = Orm.SQL(`select *, (select name from user where id = login_info.user_id) as user_name from
|
||||||
login_info limit 10`).Find(&infos)
|
login_info limit 10`).Find(&infos)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
|
|
Loading…
Reference in New Issue