|
@@ -263,6 +263,8 @@ func (session *Session) queryResult(sqlStr string, args ...interface{}) (Result,
|
|
|
return rows2Result(rows)
|
|
return rows2Result(rows)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+var BeforeExecProcessor func(sqlStr string, args []interface{})
|
|
|
|
|
+
|
|
|
func (session *Session) exec(sqlStr string, args ...interface{}) (sql.Result, error) {
|
|
func (session *Session) exec(sqlStr string, args ...interface{}) (sql.Result, error) {
|
|
|
defer session.resetStatement()
|
|
defer session.resetStatement()
|
|
|
|
|
|
|
@@ -287,6 +289,9 @@ func (session *Session) exec(sqlStr string, args ...interface{}) (sql.Result, er
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ if BeforeExecProcessor != nil {
|
|
|
|
|
+ BeforeExecProcessor(sqlStr, args)
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if !session.isAutoCommit {
|
|
if !session.isAutoCommit {
|
|
|
return session.tx.ExecContext(session.ctx, sqlStr, args...)
|
|
return session.tx.ExecContext(session.ctx, sqlStr, args...)
|