Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

sql.mysql.results

import sql.mysql.results

sql does not re-export this module, so it is reached only by importing it directly.

Turning what the server answered into the shapes the shared contract asks for.

These live apart from the connection so the statement can use them too. A statement that reached for them through the connection, which already reaches for the statement, would be a circular import.

Functions

exec_result()

sql.mysql.results.exec_result(response: dict) -> dict

What a statement run for its effect reports.

A statement that returned rows still has to answer this, since execute() may be called on anything. Its row count is zero, which is true: it changed nothing.

Parameters

  • response (dict) — From Protocol.read_response().

Returns dict — { rows_affected, last_insert_id }

select_result()

sql.mysql.results.select_result(response: dict) -> dict

What a statement run for its rows reports.

A statement that returned none still answers with the same shape and an empty result, so a caller never has to tell the two apart.

Parameters

  • response (dict) — From Protocol.read_response().

Returns dict — { columns, rows }


2026, Richard Ore and Zuri contributors