beanquery
beanquery copied to clipboard
Give better error: all non-aggregates must be covered by GROUP-BY clause
beanquery> SELECT account, SUM(CONVERT(position, 'USD', date)), balance WHERE account ~ "Expenses:" AND '2025-08-31-bangkok-thailand' in links GROUP BY 1 ORDER BY 1
error:
Traceback (most recent call last):
File "/home/tbm/.local/lib/python3.11/site-packages/beanquery/shell.py", line 244, in cmdloop
...
raise CompilationError(
beanquery.compiler.CompilationError: all non-aggregates must be covered by GROUP-BY clause in aggregate query: the following targets are missing: "balance"
woud be nice to get an error instead of a backtrace.