Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions query.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,10 @@ func (conn *Connection) QueryParameterized(sqlStatements []ParameterizedStatemen
}

func (conn *Connection) parseQueryResult(thisResult map[string]interface{}) QueryResult {
var qr QueryResult
var qr = QueryResult{
conn: conn,
rowNumber: -1,
}

// did we get an error?
_, ok := thisResult["error"]
Expand Down Expand Up @@ -231,8 +234,6 @@ func (conn *Connection) parseQueryResult(thisResult map[string]interface{}) Quer
trace("%s: fyi, no values this query", conn.ID)
}

qr.rowNumber = -1

trace("%s: this result (#col,time) %d %f", conn.ID, len(qr.columns), qr.Timing)

return qr
Expand Down Expand Up @@ -295,7 +296,6 @@ func (conn *Connection) QueryParameterizedContext(ctx context.Context, sqlStatem
for n, r := range resultsArray {
trace("%s: parsing result %d", conn.ID, n)
qr := conn.parseQueryResult(r.(map[string]interface{}))
qr.conn = conn
results = append(results, qr)
if qr.Err != nil {
errs = append(errs, qr.Err)
Expand Down
2 changes: 0 additions & 2 deletions request.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,9 @@ func (conn *Connection) RequestParameterizedContext(ctx context.Context, sqlStat
if hasValues || hasColumns {
// Presence of these keys means this is a query result
qr := conn.parseQueryResult(thisResult)
qr.conn = conn
thisR.Query = &qr
} else {
wr := conn.parseWriteResult(thisResult)
wr.conn = conn
thisR.Write = &wr
}
results = append(results, thisR)
Expand Down
3 changes: 1 addition & 2 deletions write.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func (conn *Connection) WriteParameterized(sqlStatements []ParameterizedStatemen
}

func (conn *Connection) parseWriteResult(thisResult map[string]interface{}) WriteResult {
var wr WriteResult
var wr = WriteResult{conn: conn}

// did we get an error?
_, ok := thisResult["error"]
Expand Down Expand Up @@ -209,7 +209,6 @@ func (conn *Connection) WriteParameterizedContext(ctx context.Context, sqlStatem
for n, k := range resultsArray {
trace("%s: starting on result %d", conn.ID, n)
wr := conn.parseWriteResult(k.(map[string]interface{}))
wr.conn = conn
results = append(results, wr)
if wr.Err != nil {
errs = append(errs, wr.Err)
Expand Down