That sounds right to me.

Though to be honest, I've never really understood the use cases for 
open/close/clear and I don't think I've ever used them personally.

On Tuesday, March 24, 2026 at 2:11:36 AM UTC+10:30 Chary Ev2geny wrote:

> Dear all,
>
> Coming back to this question about the traditional vs #table syntax for 
> the SELECT query
>
> On Tuesday, May 6, 2025 at 4:12:28 PM UTC+2 [email protected] wrote:
>
>
> > In this mode all the additional perks like JOURNAL, OPEN ON, CLOSE ON, 
> > BALANCES do not seem to be available. 
>
> Unless there is a bug somewhere, OPEN ON and CLOSE ON are supported also 
> when using the new syntax (although they do no always make sense). 
> JOURNAL and BALANCES can be thought as macros that expand to a regular 
> SELECT query. What do you mean when you write that the new mode does not 
> support them? 
>
>
>
> If I check at the *beanquery/parser/bql.ebnf 
> <https://github.com/beancount/beanquery/blob/master/beanquery/parser/bql.ebnf>*
>  
> language definition file
>
>
> Then for me it looks, that it is designed so, that OPEN ON, CLOSE ON and 
> CLEAR only work in the traditional (not #table) format
>
>
> select::Select
>     = 'SELECT' ['DISTINCT' distinct:`True`] targets:(','.{ target }+ | 
> asterisk)
>       ['FROM' from_clause:(_table | subselect | from)]
>       ['WHERE' where_clause:expression]
>       ['GROUP' 'BY' group_by:groupby]
>       ['ORDER' 'BY' order_by:','.{order}+]
>       ['PIVOT' 'BY' pivot_by:pivotby]
>       ['LIMIT' limit:integer]
>     ;
>
> subselect
>     = '(' @:select ')'
>     ;
>
> from::From
>     =
>     | 'OPEN' ~ 'ON' open:date ['CLOSE' ('ON' close:date | {} 
> close:`True`)] ['CLEAR' clear:`True`]
>     | 'CLOSE' ~ ('ON' close:date | {} close:`True`) ['CLEAR' clear:`True`]
>     | 'CLEAR' ~ clear:`True`
>     | expression:expression ['OPEN' 'ON' open:date] ['CLOSE' ('ON' 
> close:date | {} close:`True`)] ['CLEAR' clear:`True`]
>     ;
>
> _table::Table
>     =
>     | name:/#([a-zA-Z_][a-zA-Z0-9_]*)?/
>     | name:quoted_identifier
>     ;
>
> Or am I missing something?
>  
>

-- 
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 [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/beancount/870f81fb-0099-4a3e-9339-c151dc1c0b4fn%40googlegroups.com.

Reply via email to