Improving the HTSQL Grammar

Published by cce on 2011-04-30

These past few weeks we significantly updated the grammar to reduce the learning curve of HTSQL by making it more regular. The introduction of the tutorial and syntax reference have been updated appropriately.

Selection ({}) becomes an operator

In earlier releases the treatment of selection was ad-hoc depending upon the context where it was used. As a result, you couldn’t append .limit or other table expressions following the curly brackets. This is fixed, so you can now write:

Before you had to write:

Wildcard expression

Wildcard expression * is also normalized. Now it selects all of the output columns in the current context. Additionally, if * is followed by a number, it returns the nth output column. For example,

This mechanism can be used to filter by previously selected expressions:

Functional forms

Normalizing these syntax items permitted us to introduce functional aliases for several operators. For instance,

could now be written:

The functional form may be preferable in certain contexts since it permits you to reduce nesting depth. For example,

could be more clearly written:

blog comments powered by Disqus