mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +00:00
Remove malloc from query path
This commit is contained in:
parent
85ddbfeeee
commit
db68713809
10
conn.go
10
conn.go
@ -594,8 +594,6 @@ type QueryResultFormatsByOID map[pgtype.OID]int16
|
|||||||
// Query executes sql with args. If there is an error the returned Rows will be returned in an error state. So it is
|
// Query executes sql with args. If there is an error the returned Rows will be returned in an error state. So it is
|
||||||
// allowed to ignore the error returned from Query and handle it in Rows.
|
// allowed to ignore the error returned from Query and handle it in Rows.
|
||||||
func (c *Conn) Query(ctx context.Context, sql string, args ...interface{}) (Rows, error) {
|
func (c *Conn) Query(ctx context.Context, sql string, args ...interface{}) (Rows, error) {
|
||||||
// rows = c.getRows(sql, args)
|
|
||||||
|
|
||||||
var resultFormats QueryResultFormats
|
var resultFormats QueryResultFormats
|
||||||
var resultFormatsByOID QueryResultFormatsByOID
|
var resultFormatsByOID QueryResultFormatsByOID
|
||||||
|
|
||||||
@ -613,13 +611,7 @@ optionLoop:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rows := &connRows{
|
rows := c.getRows(sql, args)
|
||||||
logger: c,
|
|
||||||
connInfo: c.ConnInfo,
|
|
||||||
startTime: time.Now(),
|
|
||||||
sql: sql,
|
|
||||||
args: args,
|
|
||||||
}
|
|
||||||
|
|
||||||
ps, ok := c.preparedStatements[sql]
|
ps, ok := c.preparedStatements[sql]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user