Query Result¶
A QueryResult
instance is created for every query
and contains the count of rows effected by the query and either the row
as
a dict
or rows
as a list of dict
. For queries that do
not return any data, both row
and rows
will be None
.
-
class
sprockets_postgres.
QueryResult
(row_count, row, rows)[source]¶ Contains the results of the query that was executed.
- Parameters
row_count (
int
) – The quantity of rows impacted by the queryrow (
typing.Optional
[dict
]) – If a single row is returned, the data for that rowrows (
typing.Optional
[typing.List
[dict
]]) – If more than one row is returned, this attribute is set as the list of rows, in order.
-
property
rows
¶ Return the result as a list of one or more rows
- Return type