File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -535,9 +535,13 @@ type QueryResultFormats []int16
535535// QueryResultFormatsByOID controls the result format (text=0, binary=1) of a query by the result column OID.
536536type QueryResultFormatsByOID map [uint32 ]int16
537537
538- // Query executes sql with args. It is safe to attempt to read from the returned Rows even if an error is returned. The
539- // error will be the available in rows.Err() after rows are closed. So it is allowed to ignore the error returned from
540- // Query and handle it in Rows.
538+ // Query sends a query to the server and returns a Rows to read the results. Only errors encountered sending the query
539+ // and initializing Rows will be returned. Err() on the returned Rows must be checked after the Rows is closed to
540+ // determine if the query executed successfully.
541+ //
542+ // The returned Rows must be closed before the connection can be used again. It is safe to attempt to read from the
543+ // returned Rows even if an error is returned. The error will be the available in rows.Err() after rows are closed. It
544+ // is allowed to ignore the error returned from Query and handle it in Rows.
541545//
542546// Err() on the returned Rows must be checked after the Rows is closed to determine if the query executed successfully
543547// as some errors can only be detected by reading the entire response. e.g. A divide by zero error on the last row.
You can’t perform that action at this time.
0 commit comments