JDogo
Open playground

Compute expressions

A tiny, safe query language. Models write it from a schema card; the SDK evaluates it with the same results in Python, TypeScript and Java.

Run one yourself

from jdogo import run_compute

run_compute('sum(qty) where city = "Cairo"', rows)
# {'ok': True, 'value': 11, 'error': None}

Every call returns ok, value and error. It never throws on a bad expression.

Aggregates

ExpressionReturns
countNumber of matching rows
count distinct(col)Distinct non-null values
sum(col)Sum, skipping nulls; 0 when nothing matches
avg(col) min(col) max(col)Mean or extreme; null when nothing matches

Filters

Add where and a condition to any aggregate.

count where status = "SHIPPED"
avg(total) where region in ["EU", "UK"] and total >= 100
count where not (tier = "free" or email is null)

Nested data

Missing values

A key missing from a row counts as null: is null is true, comparisons are false, and != is true. A column that appears in no row at all is an error, so a typo is never a silent zero.

Group-by and beyond

Implemented everywhere, off in ask() by default. See how to turn them on.

ExpressionAnswers
group by dept with countThe biggest department. A tie is an error.
bottom group by cat with avg(price)The cheapest category on average
top 3 group by dept with sum(salary)The three best groups, best first
rank group by cat with sum(qty)Every group, best first
group by dept with count having > 10Groups that pass the test
percent(count where active = true)Share of rows, 0 to 100
percent(sum(total) where region = "EU", sum(total))Share of a total, 0 to 100. A sum or average needs the second argument; on its own it is an error
ratio(sum(a) where s = "OK", sum(a))One aggregate divided by another
median(total)The middle value

What it can't express

Arithmetic between columns (price * qty), comparisons with a computed value (amount > avg(amount)), and anything that returns rows. For those, the model replies NEED_ROWS and ask() sends the data.

Errors