On 22/10/2022 03:54, Martin Blais wrote:
> Thanks Daniele,
>
> FWIW, One thing I dreamed about a long while ago was a change to BQL to
> expose the various beancount data as multiple tables, postings,
> transactions, balanced, events, and more. I think it's more SQLish
> ("squealish"?) than the semantics I attached to FROM and TO. What you've
> done here is in that spirit, I love it. Thank you!
The infrastructure for exposing Beancount data as multiple tables (and
to allow beanquery to operate on arbitrary data) is all there. Before
adding more table definitions, I would like to reorganize the code to
better isolate the Beancount specific parts.
For backward compatibility, if a table is not specified in the FROM
clause, beanquery operates on the "postings" table. Expressions in the
FROM clause are still supported and are merged with the WHERE clause at
query compilation time. This requires a way to disambiguate between
column names part of an expression and table names in the FROM clause
and is the reason why table names need to be prefixed with "#".
Cheers,
Dan