Skip to content

Implement Row objects interface  #24

Open
@avinassh

Description

@avinassh

Docs: https://docs.python.org/3.11/library/sqlite3.html#row-objects and https://docs.python.org/3.11/library/sqlite3.html#sqlite3-howto-row-factory

This lets us do things like following:

>>> res = con.execute("SELECT 'Earth' AS name, 6378 AS radius")
>>> row = res.fetchone()

>>> row.keys()
['name', 'radius']

>>> row[0]         # Access by index.
'Earth'

>>> row["name"]    # Access by name.
'Earth'

>>> row["RADIUS"]  # Column names are case-insensitive.
6378

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions