Issue #349: docs: not clear how to run stored query (blais/beancount)

38 views
Skip to first unread message

Martin Michlmayr

unread,
Dec 19, 2018, 6:16:26 AM12/19/18
to bean...@googlegroups.com
New issue 349: docs: not clear how to run stored query
https://bitbucket.org/blais/beancount/issues/349/docs-not-clear-how-to-run-stored-query

Martin Michlmayr:

The documentation on beancount syntax has a section "Query" which described how to define stored queries. It says:

> Each query has a name, which will probably be used to invoke its running as a report type.

From this, it's not clear to me how to actually run a query.

In the end I figured out that it's "run query". Maybe this can be clarified.


Jonathan Salles

unread,
Apr 18, 2019, 8:54:33 PM4/18/19
to Beancount
I had trouble determining how to run queries too.  I'm not sure how I came to use it, but
bean-query jfsgms.bean < queries/iracontrib.qry
works for me.  Using run and adding quotes complains about the slash for the subdirectory.

Martin Michlmayr

unread,
Apr 19, 2019, 7:12:19 AM4/19/19
to bean...@googlegroups.com
* Jonathan Salles <jfs...@gmail.com> [2019-04-18 17:54]:
> I had trouble determining how to run queries too. I'm not sure how I came
> to use it, but
> bean-query jfsgms.bean < queries/iracontrib.qry

That's not a stored query though.

A stored query is when you store a query in your beancount file, e.g.

2099-12-31 query "foo" "select *"

And then you can do:

bean-query 2019.beancount 'run foo'

--
Martin Michlmayr
https://www.cyrius.com/

Jonathan Salles

unread,
Apr 19, 2019, 7:41:58 PM4/19/19
to Beancount
Thanks Martin,

I guess I missed that.  I guess either way is a good way to save and run queries.
Reply all
Reply to author
Forward
0 new messages