beanquery icon indicating copy to clipboard operation
beanquery copied to clipboard

Improve support for arrays, including `ANY()`, `ALL()` and `UNNEST()`

Open dnicolodi opened this issue 1 year ago • 0 comments
trafficstars

There is already very minimal support: tags and links are exposed as columns of type set and there are the IN and NOT IN operators. This needs to be expanded to at least include the ANY() and ALL() operators. This most likely needs support from the parser.

The type system needs to be expanded to take into consideration the type of the elements of a set or array. It makes sense to enforce that all the elements of a set or array have the same type. Use a syntax similar to the Postgresql one: type[] to indicate an array of element of type type. Maybe it is not necessary to distinguish between sets and arrays at the type system level. However, Python sets are not indexable.

Once this is done, the other_accounts in the postings table can be replaced by adding an accounts str[] fields to the entry type and usage of other_accounts can be replaced with entry.accounts.

dnicolodi avatar Jun 15 '24 20:06 dnicolodi