graflo.filter.sql¶
SQL filter helpers built on top of FilterExpression.
Provides utility functions for generating SQL WHERE fragments from structured filter parameters.
Classes¶
Functions:¶
datetime_range_filter(datetime_after, datetime_before, date_column)
¶
The half-open range [datetime_after, datetime_before) on date_column.
Returns None when neither bound is given. The result is an ordinary
filter, so a connector qualifies and joins it like its declared ones
(TableConnector.build_query(extra_filters=...)).
Source code in graflo/filter/sql.py
datetime_range_where_sql(datetime_after, datetime_before, date_column)
¶
Build SQL WHERE fragment for [datetime_after, datetime_before) via FilterExpression.
Returns empty string if both bounds are None; otherwise uses column with >= and <.
Source code in graflo/filter/sql.py
values_in_filter(columns)
¶
Rows whose column holds one of its values, for any of columns.
One IN per column, several joined with OR; values are listed in
sorted order. None when a column has no value, or values that do not
share one type among str, int and float: a literal of another
type than the column's can fail the query instead of not matching.