Add SQL string cache
This commit is contained in:
parent
d56e28a36d
commit
2ecff95e42
1 changed files with 6 additions and 1 deletions
|
@ -32,7 +32,12 @@ func buildQuery(q *Query) (string, []interface{}) {
|
|||
|
||||
defer strmangle.PutBuffer(buf)
|
||||
|
||||
return buf.String(), args
|
||||
// Cache the generated query for query object re-use
|
||||
bufStr := buf.String()
|
||||
q.plainSQL.sql = bufStr
|
||||
q.plainSQL.args = args
|
||||
|
||||
return bufStr, args
|
||||
}
|
||||
|
||||
func buildSelectQuery(q *Query) (*bytes.Buffer, []interface{}) {
|
||||
|
|
Loading…
Reference in a new issue