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])

Methods

__init__(connection, cursor[, table])

fetch_polars()

fetchall()

fetch all results.

fetchone()

fetch the first result.

Attributes

headers

__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