Using comparators
Comparators describe a single column condition in a where / values filter. Anywhere the Tables SDK accepts a filter dict — select, select_one, select_df, update, delete — you can replace a plain value with a comparator to express ranges, lists, pattern matches, null checks, and more.
The rule of thumb:
- a plain value in a filter dict means
column = value(it's equivalent to the comparatoris_eq), Nonein a filter dict meanscolumn IS NULL(it's equivalent to the comparatoris_null()),- everything else uses an explicit comparator like
is_gt(...),is_in([...]),is_ilike(...), etc.
Full list of comparators
| Function | SQL | Description |
|---|---|---|
is_eq(value) | ... = value | Equal to (same as passing value directly) |
is_neq(value) | ... <> value | Not equal to |
is_gt(value) | ... > value | Greater than |
is_gte(value) | ... >= value | Greater than or equal |
is_lt(value) | ... < value | Less than |
is_lte(value) | ... <= value | Less than or equal |
is_between(value1, value2) | ... BETWEEN value1 AND value2 | Inclusive range |
is_in(values) | ... IN (...) | Value is in the given list |
is_not_in(values) | ... NOT IN (...) | Value is not in the given list |
is_like(pattern) | ... LIKE pattern | Pattern match (case-sensitive) |
is_not_like(pattern) | ... NOT LIKE pattern | Negated pattern match |
is_ilike(pattern) | ... ILIKE pattern | Pattern match (case-insensitive) |
is_not_ilike(pattern) | ... NOT ILIKE pattern | Negated case-insensitive pattern match |
is_null() | ... IS NULL | Column is NULL (same as passing None) |
is_not_null() | ... IS NOT NULL | Column is not NULL |
All comparators are imported from abstra.tables:
Equality and inequality
is_eq is the explicit form of the default behavior and we recommend relying in the default behavior instead of explicitly using this comparator. Use is_neq when you want the opposite behavior.
Ranges (is_gt, is_gte, is_lt, is_lte, is_between)
Compare numeric, date, or datetime columns. The example below shows is_gt in select, is_gte in update, and is_lt in delete:
is_between covers an inclusive range (BETWEEN low AND high):
Lists (is_in, is_not_in)
Use a list of values for IN / NOT IN checks. is_in([]) matches no rows, including rows with NULL in the filtered column; it produces a false predicate rather than an invalid IN () clause:
Null checks (is_null, is_not_null)
None is treated as IS NULL, so is_null() is rarely needed, use it when you want to be explicit. is_not_null() has no shortcut and is the standard way to express IS NOT NULL:
Pattern matching (is_like, is_ilike, and their negations)
is_like is case-sensitive and is_ilike is case-insensitive. Both take a SQL pattern string with two wildcards:
%matches any sequence of characters, including the empty string. So"abc%"matches anything starting with"abc"("abc","abcdef", …),"%@gmail.com"matches anything ending with"@gmail.com", and"%silva%"matches anything that contains"silva"anywhere._matches exactly one character. So"a_c"matches"abc","axc","a9c".
Any character that isn't % or _ is matched literally. To match a literal % or _ in the column value, prefix it with \ (e.g. "50\%" to match the string "50%").
Combining comparators in one filter
All keys in a single filter dict are combined with AND. Use this to layer comparators:
For conditions that can't be expressed as a flat AND of column checks (joins, OR across columns, subqueries), drop down to run_sql.