Queries, APIs and SDKs · AutessaDB
Aggregations
AutessaDB aggregates run on the server: filter rows, group by a few columns, and compute COUNT, SUM, AVG, MIN and MAX, each under its own alias. HAVING filters the groups, orderBy sorts them, and a limit caps how many come back.
-- the problem
Counting rows in the client does not scale
Pulling every row to count tickets by status is slow, expensive and, if security trims rows, quietly wrong. Server-side aggregation counts only what the caller may see and returns just the totals.
What you get
- Functions: COUNT, SUM, AVG, MIN and MAX; COUNT can omit the column to count rows.
- Group by a small number of columns, or omit groupBy to total the whole filtered set.
- HAVING compares an alias with =, !=, >, <, >= or <=, and multiple conditions are combined with AND.
- Sort by a group column or an aggregate alias.
- Hidden columns are treated as not existing, and masked columns cannot be grouped or aggregated.
- Agents get the same capability through the Aggregate tool type.
-- how it works
How does aggregations work in AutessaDB?
Filter
Start with whereGroups to choose which rows count.
Group and compute
Pick groupBy columns and the aggregates, each with a unique alias.
Refine
Add having, orderBy and limit to shape the result.
-- every option
Aggregate request
| option | what it does |
|---|---|
| whereGroups | Optional pre-aggregation filter, same shape as query. |
| groupBy | Columns to group by (a small maximum applies). |
| aggregates | { function, column, alias }, with a unique alias each. |
| having | Filters on aliases, ANDed together. |
| orderBy / limit | Sort groups and cap how many return. |
-- example
Full reference in the AutessaDB CLI docs and the API reference.
-- permissions
Who can do what?
| access | can |
|---|---|
| READ | Run aggregates over rows the caller can see. |
-- faq
Questions about aggregations
Which aggregate functions are available?
COUNT, SUM, AVG, MIN and MAX on regular tables. The data lake adds full analytical SQL, including window functions.
Do aggregates respect row security?
Yes. They count only rows the caller can see, and refuse to group or aggregate columns the caller sees only as a mask.
Can I filter on the aggregate result?
Yes, with having, which compares an alias to a number.
100% customizable, code and all
Make AutessaDB fully your own.
Use it out of the box, then change anything. Ask Autobot, Autessa’s AI builder, for a new field, screen, report, workflow or agent and it builds it into your copy of the app. Or open the code and edit it yourself. Nothing is locked: the app, its data and its code are yours.
Start free and make it yours