On Thu, May 18, 2006 at 02:56:00PM +0100, Matt S Trout wrote:
> my $rs = $schema->resultset('Example')->search({ id => { '<', 1000 });
> # remember this doesn't actually run a query
>
> $schema->txn_do(
> sub { $rs->update({ foo => \"foo + 1" }); }
> );
OK, I'm just playing with more complex versions of this, and wondered - does
->update() support complex resultsets built through search()s with
attributes/joined tables?
ie.
(Assume table Extra is setup and related to Example)
my $rs = $schema->resultset('Example')->search(
{
'me.id' => { '<', 1000 },
'extra.bar' => 'qux'
},
{
join => 'extra'
}
);
$rs->update({ foo => "foo + 1" });
I just ask, because it wasn't working on my little test - the update() was
dieing with "Column foo not found". (It wasn't joining anything)
tjc
--
Turning and turning in the widening gyre/The falcon cannot hear the falconer;
Things fall apart, the centre cannot hold/Mere anarchy is loosed upon the world
(gpg --keyserver www.co.uk.pgp.net --recv-key B1CCF88E)
_______________________________________________
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/