queries.SelectQuery

Query class for SELECT operations.

Usage

Source

queries.SelectQuery(
    table,
    columns=None,
)

Methods

Name Description
__init__() Initialize a new SELECT query.
order_by() Add an ORDER BY clause to the query.
to_dataframe() Convert the query results to a pandas DataFrame.
to_pandas() Convert the query results to a pandas DataFrame.

__init__()

Initialize a new SELECT query.

Usage

Source

__init__(table, columns=None)
Parameters
table: BaseTable

The table to select from

columns: str or list of str = None
The column or columns to select

order_by()

Add an ORDER BY clause to the query.

Usage

Source

order_by(column, descending=False)
Parameters
column: str

Column name in any casing

descending: bool = False
Whether to sort in descending order
Returns
self
For method chaining
Raises
ValueError
If no column matches column.

to_dataframe()

Convert the query results to a pandas DataFrame.

Usage

Source

to_dataframe()
Returns
pandas.DataFrame
A pandas DataFrame containing the query results

to_pandas()

Convert the query results to a pandas DataFrame.

Usage

Source

to_pandas()
Returns
pandas.DataFrame
A pandas DataFrame containing the query results