zut.db.Cursor

class zut.db.Cursor(*args, **kwargs)

Bases: Protocol

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

close()

execute(sql[, params])

Attributes

description

The metadata for the columns returned in the last SQL SELECT statement, in the form of a list of tuples.

lastrowid

The rowid of the last inserted row.

rowcount

The number of rows modified by the last SQL statement.

property description: tuple[tuple[str, type | int | str | None, int | None, int | None, int | None, int | None, bool | int | None]]

The metadata for the columns returned in the last SQL SELECT statement, in the form of a list of tuples. Each tuple contains seven fields:

  1. name of the column (or column alias)

  2. type information (pyodbc: type code, the Python-equivalent class of the column, e.g. str for VARCHAR)

  3. display size (pyodbc: does not set this value)

  4. internal size (in bytes)

  5. precision

  6. scale

  7. nullable (True/False)

ref: https://peps.python.org/pep-0249/#description

property lastrowid: int | None

The rowid of the last inserted row. None if no inserted rowid.

property rowcount: int | None

The number of rows modified by the last SQL statement. Has the value of -1 or None if the number of rows is unknown or unavailable.