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

Allows browsing through the result information after performing an operation on the database through the MySQL Protocol. More...

Methods

Row fetch_one ()
 Retrieves the next Row on the ClassicResult. 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 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_affected_row_count ()
 The number of affected rows for the last 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 active result. More...
 
str get_execution_time ()
 Retrieves a string value indicating the execution time of the executed operation.
 
bool has_data ()
 Returns true if the last statement execution has a result set.
 
str get_info ()
 Retrieves a string providing information about the most recently executed statement. More...
 
int get_auto_increment_value ()
 Returns the last insert id auto generated (from an insert operation). More...
 
int get_warning_count ()
 The number of warnings produced by the last statement execution. 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...
 
bool next_data_set ()
 Prepares the SqlResult to start reading data from the next Result (if many results were returned). More...
 
bool next_result ()
 Prepares the SqlResult 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 affected_row_count
 Same as get_affected_row_count() More...
 
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()
 
int auto_increment_value
 Same as get_auto_increment_value()
 
list warnings
 Same as get_warnings()
 
int warning_count
 Same as get_warning_count() More...
 
int warnings_count
 Same as get_warnings_count()
 

Detailed Description

Allows browsing through the result information after performing an operation on the database through the MySQL Protocol.

This class allows access to the result set from the classic MySQL data model to be retrieved from Dev API queries.

Member Function Documentation

◆ fetch_one()

Row fetch_one ( )

Retrieves the next Row on the ClassicResult.

Returns
A Row object representing the next record in 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 Row objects which contains an element for every record left on the result.

Returns
A List of Row objects.

If this function is called right after executing a query, it will return a Row for every record on the resultset.

If fetchOne is called before this function, when this function is called 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_affected_row_count()

int get_affected_row_count ( )

The number of affected rows for the last operation.

Returns
the number of affected rows.
Attention
This function will be removed in a future release, use the get_affected_items_count function instead.

This is the value of the C API mysql_affected_rows(), see https://dev.mysql.com/doc/refman/en/mysql-affected-rows.html

◆ 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 metadata objects containing information about the columns included on the active result.

◆ get_info()

str get_info ( )

Retrieves a string providing information about the most recently executed statement.

Returns
a string with the execution information.

For more details, see: https://dev.mysql.com/doc/refman/en/mysql-info.html

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

For more details, see https://dev.mysql.com/doc/refman/en/information-functions.html#function_last-insert-id

◆ get_warning_count()

int get_warning_count ( )

The number of warnings produced by the last statement execution.

Returns
the number of warnings.
Attention
This function will be removed in a future release, use the get_warnings_count function instead.

This is the same value than C API mysql_warning_count, see https://dev.mysql.com/doc/refman/en/mysql-warning-count.html

See get_warnings() for more details.

See also
warnings

◆ get_warnings_count()

int get_warnings_count ( )

The number of warnings produced by the last statement execution.

Returns
the number of warnings.

This is the same value than C API mysql_warning_count, see https://dev.mysql.com/doc/refman/en/mysql-warning-count.html

See get_warnings() for more details.

See also
warnings

◆ get_warnings()

list get_warnings ( )

Retrieves the warnings generated by the executed operation.

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.

This is the same value than C API mysql_warning_count, see https://dev.mysql.com/doc/refman/en/mysql-warning-count.html

◆ next_data_set()

bool next_data_set ( )

Prepares the SqlResult 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.
Attention
This function will be removed in a future release, use the next_result function instead.

◆ next_result()

bool next_result ( )

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

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

Member Data Documentation

◆ affected_row_count

int affected_row_count

Same as get_affected_row_count()

Attention
This property will be removed in a future release, use the affected_items_count property instead.

◆ warning_count

int warning_count

Same as get_warning_count()

Attention
This property will be removed in a future release, use the warnings_count property instead.