Issue #148: bean-query makes it cumbersome to run queries from CLI (blais/beancount)

39 views
Skip to first unread message

Stefano Zacchiroli

unread,
Nov 12, 2016, 4:09:33 PM11/12/16
to bean...@googlegroups.com
New issue 148: bean-query makes it cumbersome to run queries from CLI
https://bitbucket.org/blais/beancount/issues/148/bean-query-makes-it-cumbersome-to-run

Stefano Zacchiroli:

Consider the example of the query directive given in the syntax reference:
```
#!beancount

2014-07-09 query "france-balances" "
SELECT account, sum(position) WHERE ‘trip-france-2014’ in tags"
```
Running this query requires quoting (single or double) the query name, because otherwise the SQL tokenizer will consider "france" and "balances" separate tokens. This is not so bad when using the REPL, but gets annoying on the CLI, as one has to escape the quotes to avoid shell capture, e.g.:
```
#!shell

bean-query foo.beancount run \"france-balances\"
```
Given that run accepts only a query name, the run sub-command should automatically quote its argument to ensure that the SQL tokenizer will consider it one token.

Thanks for considering!


Reply all
Reply to author
Forward
0 new messages