Reader
Source code in pbi_pyadomd/reader.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
|
column_names
fetch_many
Fetches multiple rows from the last executed query.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit
|
int | None
|
The number of rows to fetch. If None, fetches all rows. |
None
|
Returns:
Type | Description |
---|---|
list[dict[str, Any]]
|
list[dict[str, Any]]: A list of dictionaries representing the rows. |
Source code in pbi_pyadomd/reader.py
fetch_one
Fetches a single row from the last executed query as a dictionary.
Returns
dict[str, Any]: A dictionary representing the row, with column names as keys
Source code in pbi_pyadomd/reader.py
fetch_one_tuple
Fetches a single row from the last executed query as a tuple.
Returns:
Type | Description |
---|---|
tuple[Any, ...]
|
tuple[Any, ...]: A tuple representing the row, with C# values converted to their appropriate python types. |
Source code in pbi_pyadomd/reader.py
fetch_stream
Fetches the rows from the last executed query as a stream of dictionaries.
Note:
You may need to close the reader after fetching the rows if:
1. You are using a explicit limit that is shorter than the total number of
rows in the query result
2. You are tracing the command associated with the reader
This is because the trace will not create a query end record (since it
assumes the client is still reading) without explicitly closing the
reader. The reader can be closed with `self._reader.Close()`