beanquery icon indicating copy to clipboard operation
beanquery copied to clipboard

Add support for parameters in query directives

Open hhmitchell opened this issue 6 months ago • 1 comments

Currently query directives defined in a ledger can only be run as written, but it would allow for more powerful queries if they could take parameters. As a trivial example:

2100-12-31 query "foo" "select date limit %d"

Then .run foo 3 would execute the query with 3 substituted as the limit. More realistically, we could have queries like:

2100-12-31 query "bar" "select ... where year = %d and account = %s ..."

and so forth.

Brief discussion: https://groups.google.com/g/beancount/c/td18CgN1y-0

hhmitchell avatar May 21 '25 19:05 hhmitchell