mysqlx.SqlResult

class mysqlx.SqlResult(connection)

Bases: mysqlx.result.RowResult

Represents a result from a SQL statement.

Parameters

connection (mysqlx.connection.Connection) – The Connection object.

append_warning(level, code, msg)

Append a warning.

Parameters
  • level (int) – The warning level.

  • code (int) – The warning code.

  • msg (str) – The warning message.

property columns

The list of columns.

Type

list

property count

The total of items.

Type

int

fetch_all()

Fetch all items.

Returns

The list of items of mysqlx.DbDoc or

mysqlx.Row.

Return type

list

fetch_one()

Fetch one item.

Returns

one result item.

Return type

mysqlx.Row or mysqlx.DbDoc

get_affected_items_count()

Returns the number of affected items for the last operation.

Returns

The number of affected items.

Return type

int

get_autoincrement_value()

Returns the identifier for the last record inserted.

Returns

The identifier of the last record inserted.

Return type

str

get_columns()

Returns the list of columns.

Returns

The list of columns.

Return type

list

New in version 8.0.12.

get_warnings()

Returns the warnings.

Returns

The list of warnings.

Return type

list

get_warnings_count()

Returns the number of warnings.

Returns

The number of warnings.

Return type

int

has_data()

Returns True if result has data.

Returns

Returns True if result has data.

Return type

bool

New in version 8.0.12.

index_of(col_name)

Returns the index of the column.

Returns

The index of the column.

Return type

int

next_result()

Process the next result.

Returns

Returns True if the fetch is done.

Return type

bool

set_closed(flag)

Sets if resultset fetch is done.

set_generated_ids(generated_ids)

Sets the generated ids.

set_generated_insert_id(generated_id)

Sets the generated insert id.

set_has_data(flag)

Sets if result has data.

Parameters

flag (bool) – True if result has data.

set_has_more_results(flag)

Sets if has more results.

Parameters

flag (bool) – True if has more results.

set_rows_affected(total)

Sets the number of rows affected.