本文整理匯總了Golang中github.com/youtube/vitess/go/vt/dbconnpool.PoolConnection.ExecuteStreamFetch方法的典型用法代碼示例。如果您正苦於以下問題:Golang PoolConnection.ExecuteStreamFetch方法的具體用法?Golang PoolConnection.ExecuteStreamFetch怎麽用?Golang PoolConnection.ExecuteStreamFetch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/youtube/vitess/go/vt/dbconnpool.PoolConnection
的用法示例。
在下文中一共展示了PoolConnection.ExecuteStreamFetch方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: execStreamSQL
func (rqc *RequestContext) execStreamSQL(conn dbconnpool.PoolConnection, sql string, callback func(*mproto.QueryResult) error) {
start := time.Now()
err := conn.ExecuteStreamFetch(sql, callback, int(rqc.qe.streamBufferSize.Get()))
rqc.logStats.AddRewrittenSql(sql, start)
if err != nil {
panic(NewTabletErrorSql(FAIL, err))
}
}
示例2: executeStreamSql
func (qe *QueryEngine) executeStreamSql(logStats *SQLQueryStats, conn dbconnpool.PoolConnection, sql string, callback func(*mproto.QueryResult) error) {
logStats.QuerySources |= QUERY_SOURCE_MYSQL
logStats.NumberOfQueries++
logStats.AddRewrittenSql(sql)
fetchStart := time.Now()
err := conn.ExecuteStreamFetch(sql, callback, int(qe.streamBufferSize.Get()))
logStats.MysqlResponseTime += time.Now().Sub(fetchStart)
if err != nil {
panic(NewTabletErrorSql(FAIL, err))
}
}