neuralib.sqlp.stat.Cursor

class neuralib.sqlp.stat.Cursor[source]

Bases: Generic[T]

A SQL cursor wrapper.

It will try to cast to T from the tuple returns.

__init__(connection, cursor, table=None)[source]
Parameters:
  • connection (Connection)

  • cursor (sqlite3.Cursor)

  • table (type[T])

property headers: list[str]
fetchall()[source]

fetch all results.

Return type:

list[T]

fetchone()[source]

fetch the first result.

Return type:

T | None

fetch_polars()[source]
Return type:

DataFrame