MySQL Shell API 9.0.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 fetch_one ()
 Retrieves the next Row on the ShellResult. More...
 
list fetch_all ()
 Returns a list of Row objects which contains an element for every record left on the result. More...
 
int get_affected_items_count ()
 The the number of affected items for the last operation. More...
 
int get_auto_increment_value ()
 Returns the last insert id auto generated (from an insert operation). 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 current result. More...
 
str get_execution_time ()
 Retrieves a string value indicating the execution time of the operation that generated this result.
 
bool has_data ()
 Returns true if there are records in the result.
 
str get_info ()
 Retrieves a string providing additional information about the result. More...
 
int get_warnings_count ()
 The number of warnings produced by the operation that generated this result. More...
 
list get_warnings ()
 Retrieves the warnings generated by operation that generated this result. More...
 
bool next_result ()
 Prepares the ShellResult to start reading data from the next Result (if many results were returned). More...
 

Properties

int affected_items_count
 Same as get_affected_items_count()
 
int auto_increment_value
 Same as get_auto_increment_value()
 
int column_count
 Same as get_column_count()
 
list column_names
 Same as get_column_names()
 
list columns
 Same as get_columns()
 
str execution_time
 Same as get_execution_time()
 
str info
 Same as get_info()
 
list warnings
 Same as get_warnings()
 
int warnings_count
 Same as get_warnings_count()
 

Detailed Description

Encapsulates custom query result and metadata.

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

Member Function Documentation

◆ fetch_one()

Row fetch_one ( )

Retrieves the next Row on the ShellResult.

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

◆ fetch_all()

list fetch_all ( )

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 fetch_one is called before, in such case it will return a Row for each of the remaining records on the resultset.

◆ get_affected_items_count()

int get_affected_items_count ( )

The the number of affected items for the last operation.

Returns
the number of affected items.

◆ get_auto_increment_value()

int get_auto_increment_value ( )

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

Returns
the integer representing the last insert id.

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

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

◆ get_info()

str get_info ( )

Retrieves a string providing additional information about the result.

Returns
a string with the additional information.

◆ get_warnings_count()

int get_warnings_count ( )

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

Returns
the number of warnings.

See get_warnings() for more details.

See also
warnings

◆ get_warnings()

list get_warnings ( )

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.

◆ next_result()

bool next_result ( )

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.