[Dbix-class] SQL::Abstract 1.50

BUCHMULLER Norbert norbi.lists at nix.hu
Mon Feb 16 08:43:28 GMT 2009


On Sun, 15 Feb 2009 21:45:52 +0100 Zbigniew Lukasiak wrote:

> But  talking about irc - I've seen you mention that ->search({col =>
> \["func(?)", $val]}) would still not work now - why is that?

Because DBIC creates SQLA instances with {bindtype => 'columns'}, and
SQLA in the 'columns' bind type mode (ie. when it emits the bind
values in [$column_name => $value] format) should take bind values in the
same format (ie. list of arrayrefs) in the \[$sql, @bind] syntax. This is
not implemented in SQLA yet (and no failing tests - yet), but will be in
1-2 days. (So, currently it takes a list of plain values irrespective
what bindtype is set to.)

So, only the following would work in DBIC:

$rs->search({
	col => \["= func(?)", [dummy => $val]]
});

I wanted a more straightforward syntax for the above case, mst refused to
listen to me.

norbi



More information about the DBIx-Class mailing list