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

Encapsulates custom query result and metadata. More...

Methods

Row fetchOne ()
 Retrieves the next Row on the ShellResult. More...
 
List fetchAll ()
 Returns a list of Row objects which contains an element for every record left on the result. More...
 
Integer getAffectedItemsCount ()
 The the number of affected items for the last operation. More...
 
Integer getAutoIncrementValue ()
 Returns the last insert id auto generated (from an insert operation). 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 current result. More...
 
String getExecutionTime ()
 Retrieves a string value indicating the execution time of the operation that generated this result.
 
Bool hasData ()
 Returns true if there are records in the result.
 
String getInfo ()
 Retrieves a string providing additional information about the result. More...
 
Integer getWarningsCount ()
 The number of warnings produced by the operation that generated this result. More...
 
List getWarnings ()
 Retrieves the warnings generated by operation that generated this result. More...
 
Bool nextResult ()
 Prepares the ShellResult to start reading data from the next Result (if many results were returned). More...
 

Properties

Integer affectedItemsCount
 Same as getAffectedItemsCount()
 
Integer autoIncrementValue
 Same as getAutoIncrementValue()
 
Integer columnCount
 Same as getColumnCount()
 
List columnNames
 Same as getColumnNames()
 
List columns
 Same as getColumns()
 
String executionTime
 Same as getExecutionTime()
 
String info
 Same as getInfo()
 
List warnings
 Same as getWarnings()
 
Integer warningsCount
 Same as getWarningsCount()
 

Detailed Description

Encapsulates custom query result and metadata.

This class allows access to a custom result set created through shell.createResult.

Member Function Documentation

◆ fetchOne()

Row fetchOne ( )

Retrieves the next Row on the ShellResult.

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

◆ fetchAll()

List fetchAll ( )

Returns a list of Row objects which contains an element for every record left on the result.

Returns
A List of Row objects.

This function will return a Row for every record on the resultset unless fetchOne is called before, in such case it will return a Row for each of the remaining records on the resultset.

◆ getAffectedItemsCount()

Integer getAffectedItemsCount ( )

The the number of affected items for the last operation.

Returns
the number of affected items.

◆ getAutoIncrementValue()

Integer getAutoIncrementValue ( )

Returns the last insert id auto generated (from an insert operation).

Returns
the integer representing the last insert id.

◆ 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 current result.

Returns
a list of column metadata objects containing information about the columns included on the current result.

◆ getInfo()

String getInfo ( )

Retrieves a string providing additional information about the result.

Returns
a string with the additional information.

◆ getWarningsCount()

Integer getWarningsCount ( )

The number of warnings produced by the operation that generated this result.

Returns
the number of warnings.

See getWarnings() for more details.

See also
warnings

◆ getWarnings()

List getWarnings ( )

Retrieves the warnings generated by operation that generated this result.

Returns
a list containing a warning object for each generated warning.

Each warning object contains a key/value pair describing the information related to a specific warning.

This information includes: level, code and message.

◆ nextResult()

Bool nextResult ( )

Prepares the ShellResult to start reading data from the next Result (if many results were returned).

Returns
A boolean value indicating whether there is another result or not.