MySQL Shell API 9.0.1
Unified development interface for MySQL Products
Methods | Properties | List of all members
RowResult Class Reference

Allows traversing the Row objects returned by a Table.select operation. More...

Methods

Row fetch_one ()
 Retrieves the next Row on the RowResult. More...
 
dict fetch_one_object ()
 Retrieves the next Row on the result and returns it as an object. More...
 
list fetch_all ()
 Returns a list of DbDoc objects which contains an element for every unread document. More...
 
int get_column_count ()
 Retrieves the number of columns on the current result. More...
 
list get_column_names ()
 Gets the columns on the current result. More...
 
list get_columns ()
 Gets the column metadata for the columns on the active result. More...
 
- Methods inherited from BaseResult
int get_affected_items_count ()
 The the number of affected items for the last operation. More...
 
int get_warnings_count ()
 The number of warnings produced by the last statement execution. More...
 
list get_warnings ()
 Retrieves the warnings generated by the executed operation. More...
 
str get_execution_time ()
 Retrieves a string value indicating the execution time of the executed operation.
 

Properties

int column_count
 Same as get_column_count()
 
list column_names
 Same as get_column_names()
 
list columns
 Same as get_columns()
 
- Properties inherited from BaseResult
int affected_items_count
 Same as get_affected_items_count()
 
int warnings_count
 Same as get_warnings_count()
 
list warnings
 Same as get_warnings()
 
str execution_time
 Same as get_execution_time()
 

Detailed Description

Allows traversing the Row objects returned by a Table.select operation.

Member Function Documentation

◆ fetch_one()

Row fetch_one ( )

Retrieves the next Row on the RowResult.

Returns
A Row object representing the next record on the result.

◆ fetch_one_object()

dict fetch_one_object ( )

Retrieves the next Row on the result and returns it as an object.

Returns
A dictionary containing the row information.

The column names will be used as keys in the returned dictionary and the column data will be used as the key values.

If a column is a valid identifier it will be accessible as an object attribute as <dict>.<column>.

If a column is not a valid identifier, it will be accessible as a dictionary key as <dict>[<column>].

◆ fetch_all()

list fetch_all ( )

Returns a list of DbDoc objects which contains an element for every unread document.

Returns
A List of DbDoc objects.

◆ get_column_count()

int get_column_count ( )

Retrieves the number of columns on the current result.

Returns
the number of columns on the current result.

◆ get_column_names()

list get_column_names ( )

Gets the columns on the current result.

Returns
A list with the names of the columns returned on the active result.

◆ get_columns()

list get_columns ( )

Gets the column metadata for the columns on the active result.

Returns
a list of Column objects containing information about the columns included on the active result.