results.dicts() method, closes #2414

This commit is contained in:
Simon Willison 2024-09-01 17:20:41 -07:00
commit 92c4d41ca6
6 changed files with 28 additions and 17 deletions

View file

@ -1093,6 +1093,9 @@ The ``Results`` object also has the following properties and methods:
``.rows`` - list of ``sqlite3.Row``
This property provides direct access to the list of rows returned by the database. You can access specific rows by index using ``results.rows[0]``.
``.dicts()`` - list of ``dict``
This method returns a list of Python dictionaries, one for each row.
``.first()`` - row or None
Returns the first row in the results, or ``None`` if no rows were returned.