diff --git a/doc.go b/doc.go index e5c35c67..04d39748 100644 --- a/doc.go +++ b/doc.go @@ -127,10 +127,10 @@ Attention: the above 7 methods should be the last chainable method. // SELECT TOP 5 * FROM user // for mssql // SELECT * FROM user LIMIT .. OFFSET 0 //for other databases -5. Sql, let you custom SQL +5. SQL, let you custom SQL var users []User - engine.Sql("select * from user").Find(&users) + engine.SQL("select * from user").Find(&users) 6. Cols, Omit, Distinct diff --git a/engine.go b/engine.go index f92302e9..517e1005 100644 --- a/engine.go +++ b/engine.go @@ -295,11 +295,6 @@ func (engine *Engine) logSQLExecutionTime(sqlStr string, args []interface{}, exe 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 // For example: // diff --git a/examples/derive.go b/examples/derive.go index fa1e0b1a..d0c24218 100644 --- a/examples/derive.go +++ b/examples/derive.go @@ -56,7 +56,7 @@ func main() { fmt.Println(info) 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) if err != nil { fmt.Println(err)