فهرست منبع

add lost Prepare

xormplus 8 سال پیش
والد
کامیت
598acd0664
1فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 7 0
      engine.go

+ 7 - 0
engine.go

@@ -772,6 +772,13 @@ func (engine *Engine) OrderBy(order string) *Session {
 	return session.OrderBy(order)
 }
 
+// Prepare enables prepare statement
+func (engine *Engine) Prepare() *Session {
+	session := engine.NewSession()
+	session.isAutoClose = true
+	return session.Prepare()
+}
+
 // Join the join_operator should be one of INNER, LEFT OUTER, CROSS etc - this will be prepended to JOIN
 func (engine *Engine) Join(joinOperator string, tablename interface{}, condition string, args ...interface{}) *Session {
 	session := engine.NewSession()