QueryIterableResult

class borneo.QueryIterableResult(request, handle)[source]

Bases: borneo.operations.Result

QueryIterableResult comprises an iterable list of dict instances representing all the query results.

The shape of the values is based on the schema implied by the query. For example a query such as “SELECT * FROM …” that returns an intact row will return values that conform to the schema of the table. Projections return instances that conform to the schema implied by the statement. UPDATE queries either return values based on a RETURNING clause or, by default, the number of rows affected by the statement.

Each iterator from QueryIterableResult will iterate over all results of the query.

handle = ...
request = QueryRequest().set_statement('SELECT * FROM foo')
qiresult = handle.query-iterable(request)
for row in qiresult:
    # do something with the result row
    print(row)

Modification queries either return values based on a RETURNING clause or, by default, return the number of rows affected by the statement in a dictionary. INSERT queries with no RETURNING clause return a dictionary indicating the number of rows inserted, for example {‘NumRowsInserted’: 5}. UPDATE queries with no RETURNING clause return a dictionary indicating the number of rows updated, for example {‘NumRowsUpdated’: 3}. DELETE queries with no RETURNING clause return a dictionary indicating the number of rows deleted, for example {‘numRowsDeleted’: 2}.

Versionadded:5.3.6

Methods Summary

get_read_kb() Returns the read throughput consumed by this operation, in KBytes.
get_read_units() Returns the read throughput consumed by this operation, in read units.
get_write_kb() Returns the write throughput consumed by this operation, in KBytes.

Methods Documentation

get_read_kb()[source]

Returns the read throughput consumed by this operation, in KBytes. This is the cumulative actual amount of data read by the operation since the beginning of the iterable. The number of read units consumed is returned by get_read_units() which may be a larger number if the operation used Consistency.ABSOLUTE.

Returns:the read KBytes consumed.
Return type:int
get_read_units()[source]

Returns the read throughput consumed by this operation, in read units. This is the cumulative amount since the beginning of the iterable. This number may be larger than that returned by get_read_kb() if the operation used Consistency.ABSOLUTE.

Returns:the read units consumed.
Return type:int
get_write_kb()[source]

Returns the write throughput consumed by this operation, in KBytes.

Returns:the write KBytes consumed.
Return type:int