SQL::Abstract::More is a drop-in, completely compatible extension of SQL::Abstract that adds significant functionality. The main thing I like is the join syntax. The main thing I hate is that he overloaded the SQL::Abstract API, so that the same function does different things based on whether it is called with named or positional parameters:
# positional parameters, directly passed to the parent class my ($sql, @bind) = $sqla->select($table, $columns, $where, $order); # named parameters, handled in this class my ($sql, @bind) = $sqla->select( -columns => \@columns, # OR: -columns => [-distinct => @columns], -from => $table || \@joined_tables, -where => \%where, -order_by => \@order, -group_by => \@group_by, -having => \%having_criteria, -limit => $limit, -offset => $offset, # OR: -page_size => $size, -page_index => $index, -for => $purpose, );
IMHO, he should've used different function names for the different calling interface. Why? Because a function converts input to output and different input belongs in a different function. What do you think? Do you like Laurent's approach or would you have preferred a different function like me?
In reply to SQL::Abstract::More overloads the SQL::Abstract API by metaperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |