Skip to main content
DataStore provides SQL-style query building methods that compile to optimized SQL queries. All operations are lazy until results are needed.

Query Methods Overview


Selection

select

Select specific columns from the DataStore.
Examples:

Filtering

filter / where

Filter rows based on conditions. Both methods are equivalent.
Examples:

Pandas-Style Filtering


Sorting

sort / orderby

Sort rows by one or more columns.
Examples:

Limiting and Pagination

limit

Limit the number of rows returned.

offset

Skip the first n rows.
Examples:

Distinct

distinct

Remove duplicate rows.
Examples:

Grouping

groupby

Group rows by one or more columns. Returns a LazyGroupBy object.
Examples:

having

Filter groups after aggregation.
Examples:

Joining

join

Join two DataStores.
Parameters: Examples:

union

Combine results from two DataStores.
Examples:

Conditional Expressions

when

Create CASE WHEN expressions.
Examples:

Raw SQL

run_sql / sql

Execute raw SQL queries.
Examples:

to_sql

View the generated SQL without executing.
Examples:

Method Chaining

All query methods support fluent chaining:

Aliasing

as_

Set an alias for a column or subquery.
Examples:
Last modified on July 2, 2026