MySQL Shell API 9.1.0
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 fetchOne ()
 Retrieves the next Row on the RowResult. More...
 
Dictionary fetchOneObject ()
 Retrieves the next Row on the result and returns it as an object. More...
 
List fetchAll ()
 Returns a list of DbDoc objects which contains an element for every unread document. More...
 
Integer getColumnCount ()
 Retrieves the number of columns on the current result. More...
 
List getColumnNames ()
 Gets the columns on the current result. More...
 
List getColumns ()
 Gets the column metadata for the columns on the active result. More...
 
- Methods inherited from BaseResult
Integer getAffectedItemsCount ()
 The the number of affected items for the last operation. More...
 
Integer getWarningsCount ()
 The number of warnings produced by the last statement execution. More...
 
List getWarnings ()
 Retrieves the warnings generated by the executed operation. More...
 
String getExecutionTime ()
 Retrieves a string value indicating the execution time of the executed operation.
 

Properties

Integer columnCount
 Same as getColumnCount()
 
List columnNames
 Same as getColumnNames()
 
List columns
 Same as getColumns()
 
- Properties inherited from BaseResult
Integer affectedItemsCount
 Same as getAffectedItemsCount()
 
Integer warningsCount
 Same as getWarningsCount()
 
List warnings
 Same as getWarnings()
 
String executionTime
 Same as getExecutionTime()
 

Detailed Description

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

Member Function Documentation

◆ fetchOne()

Row fetchOne ( )

Retrieves the next Row on the RowResult.

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

◆ fetchOneObject()

Dictionary fetchOneObject ( )

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>].

◆ fetchAll()

List fetchAll ( )

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

Returns
A List of DbDoc objects.

◆ getColumnCount()

Integer getColumnCount ( )

Retrieves the number of columns on the current result.

Returns
the number of columns on the current result.

◆ getColumnNames()

List getColumnNames ( )

Gets the columns on the current result.

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

◆ getColumns()

List getColumns ( )

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.