More rows.Close() and rows.Err() (#3262)

Looks like we missed some `rows.Close()`

Even though `rows.Err()` is mostly not necessary, we should be more
consistent in the DB layer.

[skip ci]
This commit is contained in:
Till 2023-11-09 08:42:33 +01:00 committed by GitHub
parent ee73a90aea
commit 699f5ca8c1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
50 changed files with 101 additions and 61 deletions

View file

@ -128,7 +128,7 @@ func (s *roomStatements) SelectRoomIDsWithEvents(ctx context.Context, txn *sql.T
}
roomIDs = append(roomIDs, roomID)
}
return roomIDs, nil
return roomIDs, rows.Err()
}
func (s *roomStatements) SelectRoomInfo(ctx context.Context, txn *sql.Tx, roomID string) (*types.RoomInfo, error) {
@ -265,7 +265,7 @@ func (s *roomStatements) SelectRoomVersionsForRoomNIDs(
}
result[roomNID] = roomVersion
}
return result, nil
return result, rows.Err()
}
func (s *roomStatements) BulkSelectRoomIDs(ctx context.Context, txn *sql.Tx, roomNIDs []types.RoomNID) ([]string, error) {
@ -293,7 +293,7 @@ func (s *roomStatements) BulkSelectRoomIDs(ctx context.Context, txn *sql.Tx, roo
}
roomIDs = append(roomIDs, roomID)
}
return roomIDs, nil
return roomIDs, rows.Err()
}
func (s *roomStatements) BulkSelectRoomNIDs(ctx context.Context, txn *sql.Tx, roomIDs []string) ([]types.RoomNID, error) {
@ -321,5 +321,5 @@ func (s *roomStatements) BulkSelectRoomNIDs(ctx context.Context, txn *sql.Tx, ro
}
roomNIDs = append(roomNIDs, roomNID)
}
return roomNIDs, nil
return roomNIDs, rows.Err()
}