bean-query run QUERY where QUERY contains a space

99 views
Skip to first unread message

Oon-Ee Ng

unread,
May 21, 2021, 4:59:14 PM5/21/21
to bean...@googlegroups.com
Is the above possible? If my query looks like this:-

2021-01-01 query "Card Statement Spend"
SELECT
.....

It shows up in fava and fava can run it to get the appropriate numbers and graphs, but I can't run `bean-query "run Card Statement Spend"`. I will get the error as below:-

ERROR: Syntax error near 'statement' (at 11)

While if I try `bean-query "run 'Card Statement Spend'"`, I get instead:-

ERROR: Query 'Card Statement Spend' not found

redst...@gmail.com

unread,
May 21, 2021, 5:45:45 PM5/21/21
to Beancount
It runs fine, I use this all the time.

$ cat b.bc
plugin "beancount.plugins.auto_accounts"

2021-05-09 * "Just a check"
  Assets:Bank -100 USD
  Expenses:Groceries

2021-01-01 query "word test" "SELECT *"

$ bean-query b.bc "run 'word test'"
   date    f   narration   position
---------- - - ------------ --------
2021-05-09 *   Just a check  -100 USD
2021-05-09 *   Just a check  100 USD

Daniele Nicolodi

unread,
May 21, 2021, 6:07:49 PM5/21/21
to bean...@googlegroups.com
On 21/05/2021 23:45, redst...@gmail.com wrote:
> It runs fine, I use this all the time.
>
> $ cat b.bc
> plugin "beancount.plugins.auto_accounts"
>
> 2021-05-09 * "Just a check"
>   Assets:Bank -100 USD
>   Expenses:Groceries
>
> 2021-01-01 query "word test" "SELECT *"
>
> $ bean-query b.bc "run 'word test'"

Windows shell has weird quoting behavior thus I would not be surprised
it it does not handle correctly the nested quotes. This is where the
problem may be. Oon-Ee, on which platform are you?

Cheers,
Dan

Oon-Ee Ng

unread,
May 24, 2021, 12:20:31 AM5/24/21
to bean...@googlegroups.com
I'm using zsh on Linux...

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/2f497fd4-8767-b1df-2000-6360e53cd373%40grinta.net.
Reply all
Reply to author
Forward
0 new messages