Subject: | better support for complex queries with AND and OR |
Hello, I'm using 1.13 now and it's really nice. However, I'm having trouble finding a clean syntax when developing complex queries, especially queries that predominantly use "AND" as the joiner, but use "OR" in a sub-clause.
I also find the subtlety of how AND and OR are created sometimes hard to wrap my head around as I'm staring out it. So I'm interesting a little more explicit syntax to specify AND and OR, with an example as follows.
my @where = (
{col_1 => 'val_1', },
'AND',
[
{ col2 => 'val_2' },
'OR',
{ col3 => 'val_3 },
],
);
The functionality I'm trying to describe includes:
- Scalars found in the @where array are used to join the phrases together. They override
any default joiner already set.
- Array references within the parent where array can be used for grouping clauses together.
I think a syntax like this would be easy to read and also allows the author to be more expressive for complex queries.
What do you think?
Regards, Mark