mysqlx.Result

class mysqlx.Result(connection: Connection | None = None, ids: List[int] | None = None)

Bases: BaseResult

Allows retrieving information about non query operations performed on the database.

Parameters:

connection (mysqlx.connection.Connection) – The Connection object. ids (list): A list of IDs.

append_warning(level: int, code: int, msg: str) None

Append a warning.

Parameters:
  • level (int) – The warning level.

  • code (int) – The warning code.

  • msg (str) – The warning message.

get_affected_items_count() int

Returns the number of affected items for the last operation.

Returns:

The number of affected items.

Return type:

int

get_autoincrement_value() int

Returns the last insert id auto generated.

Returns:

The last insert id.

Return type:

int

get_document_id() int | None

Returns ID of the last document inserted into a collection.

Deprecated since version 8.0.12.

get_generated_ids() List[int]

Returns the generated ids.

get_generated_insert_id() int

Returns the generated insert id.

Deprecated since version 8.0.12.

get_warnings() List[Dict[str, int | str]]

Returns the warnings.

Returns:

The list of warnings.

Return type:

list

get_warnings_count() int

Returns the number of warnings.

Returns:

The number of warnings.

Return type:

int

set_closed(flag: bool) None

Sets if resultset fetch is done.

set_generated_ids(generated_ids: List[int]) None

Sets the generated ids.

set_generated_insert_id(generated_id: int) None

Sets the generated insert id.

set_rows_affected(total: int) None

Sets the number of rows affected.