beanquery
beanquery copied to clipboard
Default `CLOSE` date for queries stored in the ledger
According to the documentation for the query directive https://beancount.github.io/docs/beancount_language_syntax.html#query:
Also, the date of the query is intended to be the date at which the query is intended to be run for, that is, transactions following it should be ignored. If you’re familiar with the SQL syntax, it’s an implicit CLOSE.
However, when the code was origianlly written and till commit 6683356672a651c5be19775dd3d8c8c09801b922 this was not the case run from the beanquery shell as run query-name but only for queries run as part of run *.
I fear that implementing it for query execution that didn't implement it till now is going to break people workflows. However, I find the automatic CLOSE date functionality surprising enough that having it implemented only for queries executed with run * and not for other cases is just too confusing. Therefore, I'm reluctant to revert the change.
While I think that using the query directive date for the CLOSE clause is a neat idea, I'm tempted to keep things simple and just remove support for automatic CLOSE date and keep. What do you think? @blais do you use this functionality?