|
| | __init__ (self, Any response) |
| |
| "ResultSet" | raise_on_error (self) |
| |
| Iterator[Record] | __iter__ (self) |
| |
| | records (self) |
| |
| str | __str__ (self) |
| |
| Iterable[Dict[str, Any]] | as_primitive_by_row (self) |
| |
| Dict[str, List[Any]] | as_primitive_by_column (self) |
| |
| "DataFrame" | as_pandas_df (self) |
| |
| Optional[str] | as_ascii_table (self, Optional["Console"] console=None, str style="table", Optional[int] width=None, int min_width=8, Optional[int] max_width=None, int padding=1, bool collapse_padding=False) |
| |
| Record | one (self) |
| |
| Optional[Record] | one_or_none (self) |
| |
| | print (self, str style="table", Optional[int] width=None, int min_width=8, Optional[int] max_width=None, int padding=1, bool collapse_padding=False) |
| |
Definition at line 85 of file result_set.py.
◆ __init__()
| __init__ |
( |
|
self, |
|
|
Any |
response |
|
) |
| |
◆ __iter__()
| Iterator[Record] __iter__ |
( |
|
self | ) |
|
◆ __str__()
◆ as_ascii_table()
| Optional[str] as_ascii_table |
( |
|
self, |
|
|
Optional["Console"] |
console = None, |
|
|
str |
style = "table", |
|
|
Optional[int] |
width = None, |
|
|
int |
min_width = 8, |
|
|
Optional[int] |
max_width = None, |
|
|
int |
padding = 1, |
|
|
bool |
collapse_padding = False |
|
) |
| |
Print query results in a formatted table or row-by-row format. Return the string if console is not provided.
Args:
----
console: rich.console.Console instance to use for printing. If None, a new instance will be created.
style: Output style - either "table" (default) or "rows"
width: Fixed width for all columns. If None, width will be auto-calculated
min_width: Minimum width of columns when using table style
max_width: Maximum width of columns. If None, no maximum is enforced
padding: Number of spaces around cell contents in table style
collapse_padding: Reduce padding when cell contents are too wide
Examples:
--------
# Print as table (default)
result.as_ascii_table()
# Print as rows
result.as_ascii_table(style="rows")
# Customize table formatting
result.as_ascii_table(width=20, max_width=30, padding=2)
Returns:
-------
Optional[str]: Formatted representation of the results, or error message if query failed.
If console is provided, the output will be printed to the console and None will be returned.
Definition at line 205 of file result_set.py.
◆ as_pandas_df()
| "DataFrame" as_pandas_df |
( |
|
self | ) |
|
Convert result set to pandas DataFrame.
Returns
-------
pandas.DataFrame: DataFrame containing the query results
Raises
------
ImportError: If pandas is not installed
Definition at line 167 of file result_set.py.
◆ as_primitive_by_column()
| Dict[str, List[Any]] as_primitive_by_column |
( |
|
self | ) |
|
◆ as_primitive_by_row()
| Iterable[Dict[str, Any]] as_primitive_by_row |
( |
|
self | ) |
|
◆ one()
◆ one_or_none()
| Optional[Record] one_or_none |
( |
|
self | ) |
|
◆ print()
| print |
( |
|
self, |
|
|
str |
style = "table", |
|
|
Optional[int] |
width = None, |
|
|
int |
min_width = 8, |
|
|
Optional[int] |
max_width = None, |
|
|
int |
padding = 1, |
|
|
bool |
collapse_padding = False |
|
) |
| |
Print the results directly to console with rich formatting.
Args are the same as as_ascii_table().
Definition at line 319 of file result_set.py.
◆ raise_on_error()
| "ResultSet" raise_on_error |
( |
|
self | ) |
|
◆ records()
◆ _index
◆ column_names [1/2]
◆ column_names [2/2]
◆ extra_info [1/2]
◆ extra_info [2/2]
◆ is_succeeded
◆ latency_us [1/2]
◆ latency_us [2/2]
◆ plan_desc [1/2]
◆ plan_desc [2/2]
◆ result_table [1/2]
◆ result_table [2/2]
◆ size [1/2]
◆ size [2/2]
◆ status_code [1/2]
◆ status_code [2/2]
◆ status_message [1/2]
◆ status_message [2/2]
The documentation for this class was generated from the following file: