/me wrote:
> The question still is how to modify the code to support constant
> values to express something like
>
> { 'table1.key' => \'!=table2.key', 'table1.maximum => {'<', 23}}
>
> that should result in
>
> table1.key != table2.key AND table1.maximum < "23"
turned out that this cannot be easily achived, because of shortcomings
in SQL::Abstract, which doesn't support placeholders in the FROM-part
of a query.
SQL::Abstract::_recurse_where(), which is also (mis-)used to build the
part between "FROM" and "WHERE", returns an array, where the first
element is the query part that might contain "?" and subsequent values
are the bind-values. The simplest solution would be to replace all
"?"-placeholders in the first argument by the $dbh->quote()'d
subsequent values before feeding the string to SQL::Abstract::select().
At the moment I tend to simply throw_exception() if the ON-part of the
JOIN isn't either a scalar or a scalar reference.
--
Bernhard Graf
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/