2
0

Add docs clarifying that FieldDescriptions may return nil

https://github.com/jackc/pgx/issues/1634
This commit is contained in:
Jack Christensen
2023-06-14 07:42:11 -05:00
parent c542df4fb4
commit 5f28621394
3 changed files with 10 additions and 2 deletions
+5 -1
View File
@@ -28,12 +28,16 @@ type Rows interface {
// to call Close after rows is already closed.
Close()
// Err returns any error that occurred while reading.
// Err returns any error that occurred while reading. Err must only be called after the Rows is closed (either by
// calling Close or by Next returning false). If it is called early it may return nil even if there was an error
// executing the query.
Err() error
// CommandTag returns the command tag from this query. It is only available after Rows is closed.
CommandTag() pgconn.CommandTag
// FieldDescriptions returns the field descriptions of the columns. It may return nil. In particular this can occur
// when there was an error executing the query.
FieldDescriptions() []pgconn.FieldDescription
// Next prepares the next row for reading. It returns true if there is another