Subject: | does not allow for complicated SQL::Abstract queries |
Due to the column and attribute checking, it is not possible to pass in
complex queries that would work with SQL::Abstract. For example, this
query from the SQL::Abstract documentation would die with:
a "and" is not a column/accessor of class error
my @where = (
-and => [
user => 'nwiger',
-nest => [
-and => [workhrs => {'>', 20}, geo => 'ASIA' ],
-and => [workhrs => {'<', 50}, geo => 'EURO' ]
],
],
);
The column checking as implemented is not appropriate for a more complex
query even if the Class::DBI model had user and workhrs attributes.
Also, I am not sure the function checking conditional in your module
works as you would expect:
# Check for functions
if ( index( $column, '(' )
&& index( $column, ')' ))
This returns true if there are no parenthesis in $column. I think this
should be:
# Check for functions
if ( index( $column, '(' ) > 0
&& index( $column, ')' ) > 1)