Selecting rows
For more complex queries, you can use run_sql
Basic Select
To select data, you can call select function like this:
Which is equivalent to
Select with options
You can pass extra options for filtering, sorting, etc..
Using Where
where is a Dict[str, Any]. Passing many keys is equivalent to a AND clause:
Default behavior
Any value will be compared with =:
which is equivalent to
None
You can use None to check for NULL values:
which is equivalent to
Comparators
For anything beyond equality as a WHERE condition, wrap the value in a comparator like is_neq, is_gt, is_lt, is_gte, is_lte, is_between, is_in, is_like, is_ilike, is_null, etc.
See Using comparators for the full list and examples across select, update, and delete.
Select one (first matching row)
You can use select_one to get the first result:
Select by ID
You can use select_by_id as a simpler way to find a single row by id:
Returning a DataFrame
Use select_df to output a pandas DataFrame.